Skip to content
Browse files

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.
  • Loading branch information...
joshdifabio authored and muglug committed May 17, 2019
1 parent d37cdde commit 92ef851b9c55f039eb3e1a5a2be1241097a37c7a
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Psalm/Codebase.php
@@ -1113,7 +1113,7 @@ public function getCompletionDataAtPosition(string $file_path, Position $positio
return null;
$gap = substr($file_contents, $end_pos, $offset - $end_pos);
$gap = substr($file_contents, $end_pos, 2);
return [$recent_type, $gap];

0 comments on commit 92ef851

Please sign in to comment.
You can’t perform that action at this time.