mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Fix completions when editing existing item
Many completion snippets insert more than just the name. For example, the object completer inserts the braces and places your cursor inside them automatically, to save some typing. However, if you're changing the class of an existing object, this isn't what you want. Changed so that if the next token is '{', only the name is inserted. Made similar changes to the property and signal completers.
This commit is contained in:
parent
29e4a56bfc
commit
461fe25316
13 changed files with 122 additions and 97 deletions
|
@ -64,11 +64,11 @@ class TestSamples(unittest.TestCase):
|
|||
|
||||
def assert_ast_doesnt_crash(self, text, tokens, ast: AstNode):
|
||||
lsp = LanguageServer()
|
||||
for i in range(len(text)):
|
||||
for i in range(len(text) + 1):
|
||||
ast.get_docs(i)
|
||||
for i in range(len(text)):
|
||||
for i in range(len(text) + 1):
|
||||
list(complete(lsp, ast, tokens, i))
|
||||
for i in range(len(text)):
|
||||
for i in range(len(text) + 1):
|
||||
ast.get_reference(i)
|
||||
ast.get_document_symbols()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue