Improve completions

If the completion cursor is in the middle of an identifier, start the
completion matching before that token. GNOME Builder does this before
sending us a cursor position, but VS Code does not.
This commit is contained in:
James Westman 2021-10-30 21:25:15 -05:00
parent 54237d7976
commit b2b50c6288
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
2 changed files with 6 additions and 3 deletions

View file

@ -83,7 +83,7 @@ class Completion:
insert_text = self.snippet
insert_text_format = InsertTextFormat.Snippet
return {
result = {
"label": self.label,
"kind": self.kind,
"tags": [CompletionItemTag.Deprecated] if self.deprecated else None,
@ -93,3 +93,4 @@ class Completion:
"insertText": insert_text,
"insertTextFormat": insert_text_format,
}
return { k: v for k, v in result.items() if v is not None }