mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-06-22 23:19:25 -04:00
lsp: Add code action to add missing imports
This commit is contained in:
parent
3bcc9f4cbd
commit
35ee058192
3 changed files with 47 additions and 3 deletions
|
@ -55,7 +55,16 @@ class TypeName(AstNode):
|
|||
@validate("namespace")
|
||||
def gir_ns_exists(self):
|
||||
if not self.tokens["extern"]:
|
||||
self.root.gir.validate_ns(self.tokens["namespace"])
|
||||
try:
|
||||
self.root.gir.validate_ns(self.tokens["namespace"])
|
||||
except CompileError as e:
|
||||
ns = self.tokens["namespace"]
|
||||
e.actions = [
|
||||
self.root.import_code_action(n, version)
|
||||
for n, version in gir.get_available_namespaces()
|
||||
if n == ns
|
||||
]
|
||||
raise e
|
||||
|
||||
@validate()
|
||||
def deprecated(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue