mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Reduce errors when a namespace is not found
When the typelib for a namespace is not found, don't emit "namespace not imported" errors. Just emit the one error on the import statement.
This commit is contained in:
parent
402677f687
commit
bc605c5df8
6 changed files with 20 additions and 1 deletions
|
@ -741,6 +741,7 @@ class Repository(GirNode):
|
|||
class GirContext:
|
||||
def __init__(self):
|
||||
self.namespaces = {}
|
||||
self.not_found_namespaces: T.Set[str] = set()
|
||||
|
||||
def add_namespace(self, namespace: Namespace):
|
||||
other = self.namespaces.get(namespace.name)
|
||||
|
@ -781,7 +782,7 @@ class GirContext:
|
|||
|
||||
ns = ns or "Gtk"
|
||||
|
||||
if ns not in self.namespaces:
|
||||
if ns not in self.namespaces and ns not in self.not_found_namespaces:
|
||||
raise CompileError(
|
||||
f"Namespace {ns} was not imported",
|
||||
did_you_mean=(ns, self.namespaces.keys()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue