From fa3b84d61261867b40c3a9094b5ad51439be1746 Mon Sep 17 00:00:00 2001 From: Octavian Alexandru Butiu Date: Wed, 19 Mar 2025 22:14:24 +0200 Subject: [PATCH 1/2] port: Fix build error when building in a flatpak If you create a project with gnome builder and port it blueprint and try to build it in flatpak you will get a compiler error that /org/gnome/Example/window.ui. Setting the source_dir variable in meson fixes this. --- blueprintcompiler/interactive_port.py | 1 + 1 file changed, 1 insertion(+) diff --git a/blueprintcompiler/interactive_port.py b/blueprintcompiler/interactive_port.py index 0c37885..26d8e2a 100644 --- a/blueprintcompiler/interactive_port.py +++ b/blueprintcompiler/interactive_port.py @@ -266,6 +266,7 @@ blueprints = custom_target('blueprints', arguments in {Colors.UNDERLINE}{meson_file}{Colors.NO_UNDERLINE}:{Colors.CLEAR} dependencies: blueprints, +source_dir: meson.current_build_dir(), """ ) enter() From f50b898e4ce74d84cfa92ce44e90f9aaca2ec133 Mon Sep 17 00:00:00 2001 From: James Westman Date: Tue, 1 Apr 2025 19:27:59 -0500 Subject: [PATCH 2/2] adw_breakpoint: Fix crash in language server Fix a crash that happened when an AdwBreakpointSetter rule was incomplete, such as when you're still typing it. Fixes #189. --- blueprintcompiler/language/adw_breakpoint.py | 9 ++++++--- blueprintcompiler/outputs/xml/__init__.py | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/blueprintcompiler/language/adw_breakpoint.py b/blueprintcompiler/language/adw_breakpoint.py index 4ad5b24..3d2c10d 100644 --- a/blueprintcompiler/language/adw_breakpoint.py +++ b/blueprintcompiler/language/adw_breakpoint.py @@ -81,8 +81,8 @@ class AdwBreakpointSetter(AstNode): return self.tokens["property"] @property - def value(self) -> Value: - return self.children[Value][0] + def value(self) -> T.Optional[Value]: + return self.children[Value][0] if len(self.children[Value]) > 0 else None @property def gir_class(self) -> T.Optional[GirType]: @@ -106,7 +106,10 @@ class AdwBreakpointSetter(AstNode): return None @property - def document_symbol(self) -> DocumentSymbol: + def document_symbol(self) -> T.Optional[DocumentSymbol]: + if self.value is None: + return None + return DocumentSymbol( f"{self.object_id}.{self.property_name}", SymbolKind.Property, diff --git a/blueprintcompiler/outputs/xml/__init__.py b/blueprintcompiler/outputs/xml/__init__.py index 5c03761..15850f7 100644 --- a/blueprintcompiler/outputs/xml/__init__.py +++ b/blueprintcompiler/outputs/xml/__init__.py @@ -308,6 +308,9 @@ class XmlOutput(OutputFormat): elif isinstance(extension, AdwBreakpointSetters): for setter in extension.setters: + if setter.value is None: + continue + attrs = {} if isinstance(setter.value.child, Translated):