1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

LanguageServer: Handle late completion requests

Currently, Psalm Language Server is only able to handle completion
requests where the gap between a recent known type and the current
cursor position is exactly '->' or '::'. However, VS code often doesn't
send a completion request until an additional, third character has
been typed. This change allows Psalm to successfully serve
completion requests where an additional character has been typed.
This commit is contained in:
Josh Di Fabio 2019-05-17 12:16:59 +01:00 committed by Matthew Brown
parent d37cddea27
commit 92ef851b9c

View File

@ -1113,7 +1113,7 @@ class Codebase
return null;
}
$gap = substr($file_contents, $end_pos, $offset - $end_pos);
$gap = substr($file_contents, $end_pos, 2);
return [$recent_type, $gap];
}