Merge branch 'completion-improvements' into 'main'

Completion improvements

See merge request GNOME/blueprint-compiler!243
This commit is contained in:
James Westman 2025-05-08 09:08:38 +00:00
commit 90b60e4de7
39 changed files with 814 additions and 268 deletions

View file

@ -1 +1 @@
4,6,22,Action widget must have ID
4,5,24,Action widget must have ID

View file

@ -1 +1 @@
4,6,18,Gtk.Box doesn't have action widgets
4,5,20,Gtk.Box doesn't have action widgets

View file

@ -0,0 +1,5 @@
using Gtk 4.0;
Button {
child: false;
}

View file

@ -0,0 +1 @@
4,10,5,Cannot assign boolean to Gtk.Widget

View file

@ -1 +1 @@
1,0,0,File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)
1,1,0,File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)

View file

@ -1 +1 @@
6,1,1,Expected `;`
5,4,0,Expected `;`

View file

@ -1,2 +1 @@
5,1,0,Expected a signal detail name
4,9,3,Unexpected tokens
4,11,0,Expected a signal detail name

View file

@ -1,2 +1 @@
4,5,21,Attributes are not permitted at the top level of a menu
4,16,10,Unexpected tokens
4,5,21,Attributes are not permitted at the top level of a menu

View file

@ -1 +1 @@
1,11,0,Expected a version number for GTK
1,10,0,Expected a version number for GTK

View file

@ -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()
@ -143,9 +143,9 @@ class TestSamples(unittest.TestCase):
]
def error_str(error: CompileError):
line, col = utils.idx_to_pos(error.range.start + 1, blueprint)
line, col = utils.idx_to_pos(error.range.start, blueprint)
len = error.range.length
return ",".join([str(line + 1), str(col), str(len), error.message])
return ",".join([str(line + 1), str(col + 1), str(len), error.message])
actual = "\n".join([error_str(error) for error in errors])