SublimePHPCompanion icon indicating copy to clipboard operation
SublimePHPCompanion copied to clipboard

Feature Request: Support for language server protocol

Open swaner opened this issue 5 years ago • 5 comments

This is just a feature request/question of how much work it would take to support the language server protocol.

Description from https://microsoft.github.io/language-server-protocol:

The idea behind the Language Server Protocol (LSP) is to standardize the protocol for how such servers and development tools communicate. This way, a single Language Server can be re-used in multiple development tools, which in turn can support multiple languages with minimal effort.

VS Code supports language server protocol. Since there is no good php extension today for VS Code, and if it's possible to modify SublimePHPCompanion it would make an excellent choice. Since my python skills are close to none I cannot help with development but am wondering if this would be even possible with this library?

swaner avatar Nov 02 '18 14:11 swaner

Thanks to this plugin: https://packagecontrol.io/packages/LSP, SublimeText could benefit from supporting the protocol as well

lumnn avatar Nov 20 '18 09:11 lumnn

As @lumnn says, such a plugin already exists for SublimeText, so I don't see the point of including LSP in PHP Companion.

erichard avatar Dec 04 '18 10:12 erichard

@erichard I think you misunderstood me. My point is that if the SublimePHPCompanion is a LSP compatible tool, then can be used by more editors including Sublime. Thanks to a plugin I've posted in my last comment it may share a same user interface as other intelligence plugins, as the plugin above is only a UI for LSP in Sublime.

On the other hand I understand it probably means a lot of work.

lumnn avatar Dec 04 '18 13:12 lumnn

@lumnn You are right, I totally misunderstood you :smile:

So has I understand, LSP is all about standardizing autocompletion, go to definition, or documentation on hover. PHP Companion does nothing of these things. I see it as a smart snippet plugin, it write code in your file when you hit some specific key. I will dig deeper in the LSP spec to see if I missed something.

In the meantine can you develop what you have in mind about a LSP integration ?

erichard avatar Dec 04 '18 13:12 erichard

@erichard I believe the codeAction requests could be used for few functions in this plugin. See: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction

I believe almost all commands could be developed as LSP code action (except goto_definition_scope which looks like definition request https://microsoft.github.io/language-server-protocol/specification#textDocument_definition)

lumnn avatar Dec 04 '18 18:12 lumnn