1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 02:47:02 +01:00
Commit Graph

22 Commits

Author SHA1 Message Date
Joram Schrijver
0b39884974 Fix some return values in the language server (#2134)
* 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.
2019-09-14 10:14:03 -04:00
Tyson Andre
5d5a9c6eac Remove redundant casts and unused use statements (#1955)
* Remove redundant casts

(not sure about older versions of php-parser)

* Remove unused use statements
2019-07-18 23:37:36 -04:00
Matthew Brown
8d63d5dc4e Add lookup for builtin functions 2019-07-18 23:30:44 -04:00
Matthew Brown
5583ae842e Refactor signature selection a little 2019-07-18 23:08:54 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Ilija Tovilo
67c3726254 Implement signature help - closes #1841 (#1862)
* 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()
2019-07-01 15:54:32 -04:00
Matthew Brown
ca53019d6b Simplify class completion lookup
Ref #1822
2019-06-29 21:32:26 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Brown
aa6677a177 Add autocompletion for some classes
Ref #1822
2019-06-21 17:10:35 -04:00
Brown
844442e039 Fix #1780 - set open file contents on save 2019-06-13 15:25:55 -04:00
Josh Di Fabio
78a9d1aa9b Ensure any queued file analyses are done before completion
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.
2019-06-13 09:04:52 -04:00
Brown
a1c9ad501b Fix #1654 - understand templated completions 2019-05-17 12:11:27 -04:00
Brown
751253ddf0 Fix #1603 - prevent invalid covariant template classes from being passed 2019-05-06 16:38:08 -04:00
Bruce Weirdan
8408effe57 Dropped unused uses 2019-02-17 13:17:45 -05:00
Aaron Piotrowski
b0d97843ce Update Amp usage
Fixed a few errors and used byte-stream for reading and writing.
2019-02-06 16:08:41 -05:00
Matthew Brown
263a4c8cf1 Use Amp for handling language server event loop 2019-02-06 16:08:41 -05:00
Matthew Brown
37aef674a1 Remove unused library 2019-01-15 22:17:45 -05:00
Brown
7855683271 Convert @return Promise<...> to @psalm-return Promise<...> 2018-12-14 10:27:39 -05:00
Matthew Brown
b052e211a0 Improve internal typing for sabre/event promises 2018-12-10 23:18:53 -05:00
Brown
b5f0159cdf Add backup hover analysis when file isn’t analysed 2018-11-20 16:32:40 -05:00
Matthew Brown
c2e546facb Fix #531
Well, it’s basically fixed already, but this adds @TysonAndre’s suggestions (and some of the relevant implementation from Phan)
2018-11-17 18:01:27 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00