Code Monkey home page Code Monkey logo

lsp_php's Introduction

lsp_php

A Language Server Protocol server for PHP written in PHP.

This LSP is written in PHP 8.x and uses Reflection to get info about the PHP code.
It is a partial implementation of the LSP specification 3.17. It was tested with the helix editor.

Configuration

Example configration for helix in .config/helix/languages.toml

[language-server.php]
  command = "lsp.php"
  args = ['-l', '-iphpinclude']

[[language]]
  language-servers = ["php"]

Usage

Usage: lsp.php [OPTIONS]
Options:
  -a=SUFFIX, --autoload=SUFFIX    Autoload from include_path with SUFFIX, [.php,.inc]
  -c=CMDS,   --check-cmds=CMDS    Run syntax check/lint CMDS on code [php -nl,phplint.php -f]
  -C,        --check-only         Only run check-cmds, no other functionality
  -f,        --full-sync          Use full instead of incremental sync
  -h,        --help               Show usage
  -i=PATH,   --include-path=PATH  Prepend PATH to the include path [phpinclude]
  -l=FILE,   --log=FILE           Enable logging to FILE, [~/.cache/helix/lsp_php.log]

Features

Currently is supports the following language features:

Command Description helix keymap
textDocument/definition Go to function definition (same as go to implementation) gd
textDocument/implementation Go to function implementation (same as go to definition) gi
textDocument/references Go to static function reference, currently only works with git gr
textDocument/completion Show completion for PHP builtin functions or static method in classes ctrl-x or foo::
textDocument/codeAction Perform a code action on a selection, currently blockify Space + a
textDocument/publishDiagnostics Run syntax check/lint on text changes and display errors/warnings Space + d
textDocument/hover Show function definition, i.e. parameters, return type and doccomment Space + k
textDocument/documentSymbol List of functions/methods defined in current document Space + s

lsp_php's People

Contributors

chschneider avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.