* Add documention to LSP
Add descriptions for all Classes, Functions, Methods, Class Constants for LSP methods for Hover, SignatureInformation and Completions
* Descriptions for class name completions
* PHPCS
* Fix docblock being overriden
* Remove trailing comma in args
* Add description to function param before early `continue`
* Update php-language-server-protocol to 1.5
* Break up long array docblocks
* Break up docblock onto newline
Co-authored-by: Matthew Brown <github@muglug.com>
* Add completions for known array keys
* Use dynamic gap value
* Provide completions for known type contexts
* Fix formatting
* Remove trailing comma
* PHPCS fixes
* Remove support for literal floats
* Fix test for floats
* Fix missing parameter in LSP textDocument.didChange
This parameter was accepted, but not documented. Since the JSON-RPC
Dispatcher looks at the comments for type information, it would fail
to find info and produce:
PHP Notice: Undefined offset: 1 in vendor/felixfbecker/advanced-json-rpc/lib/Dispatcher.php on line 141
Combined with issue #4142, this ended up violating the protocol.
* Ignore out-of-project files in textDocument.completion
Other methods, such as didOpen and didChange already checked for this,
but completion did not. This would lead to funny behaviour, where
triggering completion would cause the file to be analyzed, but only
using the on-disk state. And any changes to the file would never be
analyzed.
This ignores out-of-project files for completion, too.
* Added new language server options and functionality.
Added new extended diagnostic code information to the language server.
-- It must be enabled via a command line switch.
Added telemetry data for language server initialization and operation.
Added verbose log messages for language server.
-- It must be enabled via a command line switch.
* fixed phpcs issues
* fixed failing tests
* changed the language server reported error code to be the help link
Co-authored-by: Anthony Rainer <0@0ze.ro>
* add list<> notation in stubs
* change phpdoc to be compatible with expected list<>
* change interface phpdoc to be compatible with expected list<>
* revert array_chunk => special case to handle with preserve keys.
* change array_chunk return to match both behaviour
* revert list<> notation in parameters where not required
* Fix return value of LSP shutdown
It is specified as a request that returns null. Returning void causes
the language server to crash.
* Fix empty responses of LSP textDocument/definition
It is specified to return either a Location, an array of Locations, or
null. Hovers are unrelated.
* Fix responses of LSP textDocument/hover
It is specified to either return Hover or null. Psalm could previously
return a success response containing a MarkedString, but with a null
value. MarkedString is not allowed to contain null.
* Implement signature help - closes#1841
* Add explicit signature count
* [LSP] Do analysis for every signatureHelp request
See here: https://github.com/vimeo/psalm/pull/1862#issuecomment-507007346
* Don’t language server information when checking property for init
* Fix signature help for functions
* Add try-catch around signature help Functions::getStorage()
Language Server
---------------
When typing quickly, the LSP client can send multiple messages
in a group, including didChange messages followed by completion
messages. Currently, LanguageServer::doAnalysis() is only called
after a message group is processed. This can result in completion
being done with outdated file contents for example:
Message group with two messages is received
1. `didChange`: file analysis is queued for modified file
2. `completion`: completion attempted on stale file contents
3. `messageGroupRead`: analysis is done, but too late for completion
This commit ensures that any queued file analyses are done prior
to serving completion requests.
* Revert "Revert "Implement better progress""
This reverts commit 4302596654.
* Revert "Revert "Implement dots progress bar""
This reverts commit e41733d789.
* Revert "Revert "Switch to VoidProgress by default""
This reverts commit 304ffeb0a3.
* Revert "Revert "Pass success flag to progress""
This reverts commit 62a690ee4e.
* Improve socket communication
* Use an underscore
* Add means to disable progress
* Add extra newline before progress bar