diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index a5367caf..f014be61 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -17,7 +17,8 @@ FormattingOptions, TextEdit, CompletionItem, - CompletionItemKind + CompletionItemKind, + CompletionList }; use LanguageServer\Server\Completion\PHPKeywords; @@ -166,7 +167,9 @@ public function formatting(TextDocumentIdentifier $textDocument, FormattingOptio public function completion(TextDocumentIdentifier $textDocument, Position $position) { - $items = []; + $list = new CompletionList(); + $list->isIncomplete = false; + $list->items = []; $keywords = new PHPKeywords(); foreach ($keywords->getKeywords() as $keyword){ $item = new CompletionItem(); @@ -174,9 +177,9 @@ public function completion(TextDocumentIdentifier $textDocument, Position $posit $item->kind = CompletionItemKind::KEYWORD; $item->insertText = $keyword->getInsertText(); $item->detail = "PHP Language Server"; - $items[] = $item; + $list->items[] = $item; } - return $items; + return $list; } }