All Projects → tsufeki → Tenkawa Php Language Server

tsufeki / Tenkawa Php Language Server

Licence: gpl-3.0
Language server for PHP, with powerful static analysis and type inference.

Projects that are alternatives of or similar to Tenkawa Php Language Server

vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-64.1%)
Mutual labels:  autocompletion, language-server, static-analysis, lsp
Elm Language Server
Language server implementation for Elm
Stars: ✭ 298 (+282.05%)
Mutual labels:  lsp, language-server
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-60.26%)
Mutual labels:  language-server, lsp
Monaco Languageclient
NPM module to connect Monaco editor with language servers
Stars: ✭ 419 (+437.18%)
Mutual labels:  lsp, language-server
atom-ide-scala
Scala & Dotty support for Atom IDE (🧟‍♂️ zombie repo)
Stars: ✭ 47 (-39.74%)
Mutual labels:  language-server, lsp
ltex-ls
LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others
Stars: ✭ 182 (+133.33%)
Mutual labels:  language-server, lsp
Terraform Ls
Terraform Language Server
Stars: ✭ 389 (+398.72%)
Mutual labels:  lsp, language-server
groovy-language-server
A language server for Groovy
Stars: ✭ 132 (+69.23%)
Mutual labels:  language-server, lsp
Clojure Lsp
Language Server (LSP) for Clojure
Stars: ✭ 547 (+601.28%)
Mutual labels:  lsp, language-server
Kotlin Language Server
Intelligent Kotlin support for any editor/IDE using the Language Server Protocol
Stars: ✭ 650 (+733.33%)
Mutual labels:  lsp, language-server
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+920.51%)
Mutual labels:  lsp, autocompletion
Spyglass
Development tools for vanilla Minecraft: Java Edition data pack developers.
Stars: ✭ 163 (+108.97%)
Mutual labels:  language-server, lsp
Protocol Buffers Language Server
[WIP] Protocol Buffers Language Server
Stars: ✭ 44 (-43.59%)
Mutual labels:  lsp, language-server
toy-language-server
Example language server (LSP) implementation for a toy language
Stars: ✭ 54 (-30.77%)
Mutual labels:  language-server, lsp
typescript-language-server
TypeScript & JavaScript Language Server
Stars: ✭ 1,118 (+1333.33%)
Mutual labels:  language-server, lsp
Erlang ls
The Erlang Language Server
Stars: ✭ 363 (+365.38%)
Mutual labels:  lsp, language-server
sublime-reason
Official Reason plugin for Sublime Text
Stars: ✭ 42 (-46.15%)
Mutual labels:  language-server, lsp
yoda
Experimental: Static Analyzer and Language Server for Ruby
Stars: ✭ 24 (-69.23%)
Mutual labels:  autocompletion, language-server
Typescript Language Server
TypeScript & JavaScript Language Server
Stars: ✭ 462 (+492.31%)
Mutual labels:  lsp, language-server
Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+1206.41%)
Mutual labels:  static-analysis, language-server

Tenkawa PHP Language Server

Tenkawa

Tenkawa is a language server for PHP, with powerful static analysis and type inference engine borrowed without asking from PHPStan.

Still experimental, but should be usable. Any bug reports, feature requests, suggestions, questions are welcome.

Installation

Requires PHP >= 7.1 with pdo_sqlite extension.

For Visual Studio Code extension, see here.

Either with composer create-project (~ directory is an example):

$ cd ~
$ composer create-project --no-dev --keep-vcs \
    tsufeki/tenkawa-php-language-server tenkawa/

Or by cloning the repo:

$ cd ~
$ git clone https://github.com/tsufeki/tenkawa-php-language-server.git tenkawa/
$ cd tenkawa/
$ composer install --no-dev
$ cd ..

Build index of the standard library:

$ php ~/tenkawa/bin/tenkawa.php --build-index

Now configure your client to start the server with this command to use stdio:

php ~/tenkawa/bin/tenkawa.php

Or to connect to a TCP socket:

php ~/tenkawa/bin/tenkawa.php --socket=tcp://127.0.0.1:12345

Features

  • ✔ Autocompletion
    • ✔ Classes/functions (also with automatic import and within doc comments)
    • ✔ Class members
    • ✔ Local variables
  • ✔ Diagnostics
  • ✔ Go to definition
  • ✔ Go to implementation
  • ✔ Hover info
  • ✔ Signature help
  • ✔ References
  • ✔ Document symbols
  • ✔ Workspace symbols
    • ✔ Classes/functions/consts
    • ✘ Class members (not yet)
  • ✔ Code actions
    • ✔ Import class/function
    • ✔ Fix wrong autoloaded class/namespace name
    • ✘ More to come...
  • ✔ Multi-root workspace
  • ✔ Snippets
    • ✔ Class/interface/trait
  • ✔ Dynamic configuration

Unimplemented (yet?):

  • ✘ Go to type definition
  • ✘ Go to declaration
  • ✘ Document highlight
  • ✘ Document link
  • ✘ Code lens
  • ✘ Formatting
    • ✘ document
    • ✘ range
    • ✘ on type
  • ✘ Rename
  • ✘ Folding range

Known issues

  • Many features don't work inside traits. This is caused by PHPStan's design.
  • Refactors are not 100% bullet-proof.
  • Performance & long indexing times.

Command line options

  • --socket=<socket> - connect to a socket instead of communicating through STDIO. Allowed format: tcp://127.0.0.1:12345 or unix:///path/to/socket.
  • --log-stderr - log to stderr.
  • --log-file=<file> - log to the given file.
  • --log-client - log using window/logMessage protocol method.
  • --log-level=<level> - log only messages of the given level and up. <level> can be one of emergency, alert, critical, error, warning, notice, info, debug. Defaults to info.
  • --build-index - build standard library index instead of starting the server.
  • --config-json=<json> - default options, see Configuration. Example: --config-json={"completion":{"autoImport":false}}.

Configuration

You can pass configuration options to the server through initializationOptions parameter of initialize protocol method or by implementing workspace/configuration request and sending workspace/didChangeConfiguration notifications from client.

Recognized options:

{
  "tenkawaphp": {
    "diagnostics": {
      "phpstan": {
        // Enable PHPStan diagnostics.
        "enabled": true
      }
    },
    "completion": {
      // Enable automatic import (use) of completed classes.
      "autoImport": true,
      // By default, only some PHP extensions are used for autocompletion.
      // Additional ones can be enabled here.
      "extensions": ["mysqli", "redis"]
    },
    "index": {
      // Additional stubs directories
      "stubs": ["/path/to/stubs/dir"]
    }
  }
}

Licence

Copyright (c) 2017 tsufeki

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].