From f48b840cfa478d6bfeb6e16f24fd5b650c70e4f2 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Wed, 20 Nov 2024 10:41:56 +0100 Subject: [PATCH 1/5] compile: fix flag values gtk builder does not support combining interger values with | in flags properties, so the short names are used instead. --- blueprintcompiler/language/values.py | 2 +- tests/samples/flags.ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/language/values.py b/blueprintcompiler/language/values.py index 63cf4fc..e060b65 100644 --- a/blueprintcompiler/language/values.py +++ b/blueprintcompiler/language/values.py @@ -216,7 +216,7 @@ class Flag(AstNode): if not isinstance(type, Enumeration): return None elif member := type.members.get(self.name): - return member.value + return member.name else: return None diff --git a/tests/samples/flags.ui b/tests/samples/flags.ui index 2f0a26e..d13c424 100644 --- a/tests/samples/flags.ui +++ b/tests/samples/flags.ui @@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler. - 1|4 + is_service|handles_open 1 From 2ae41020abfb04649e9791f57c84fc708d428283 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Thu, 21 Nov 2024 09:28:40 +0100 Subject: [PATCH 2/5] Fix flag return value type --- blueprintcompiler/language/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprintcompiler/language/values.py b/blueprintcompiler/language/values.py index e060b65..4cd600d 100644 --- a/blueprintcompiler/language/values.py +++ b/blueprintcompiler/language/values.py @@ -211,7 +211,7 @@ class Flag(AstNode): return self.tokens["value"] @property - def value(self) -> T.Optional[int]: + def value(self) -> T.Optional[str]: type = self.context[ValueTypeCtx].value_type if not isinstance(type, Enumeration): return None From e07da3c33946e7ab4afed9c564a9e7ae0b3fbbb8 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Tue, 26 Nov 2024 10:52:37 +0100 Subject: [PATCH 3/5] flags: use nick instead of name --- blueprintcompiler/language/values.py | 2 +- tests/samples/flags.ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/language/values.py b/blueprintcompiler/language/values.py index 4cd600d..96787ee 100644 --- a/blueprintcompiler/language/values.py +++ b/blueprintcompiler/language/values.py @@ -216,7 +216,7 @@ class Flag(AstNode): if not isinstance(type, Enumeration): return None elif member := type.members.get(self.name): - return member.name + return member.nick else: return None diff --git a/tests/samples/flags.ui b/tests/samples/flags.ui index d13c424..44eb2c4 100644 --- a/tests/samples/flags.ui +++ b/tests/samples/flags.ui @@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler. - is_service|handles_open + is-service|handles-open 1 From 04ef0944db56ab01307a29aaa7303df6067cb3c0 Mon Sep 17 00:00:00 2001 From: James Westman Date: Fri, 17 Jan 2025 17:04:52 -0600 Subject: [PATCH 4/5] Release v0.16.0 --- NEWS.md | 32 ++++++++++++++++++++++++++++++++ docs/flatpak.rst | 2 +- meson.build | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 389f82c..a12dab0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,35 @@ +# v0.16.0 + +## Added +- Added more "go to reference" implementations in the language server +- Added semantic token support for flag members in the language server +- Added property documentation to the hover tooltip for notify signals +- The language server now shows relevant sections of the reference documentation when hovering over keywords and symbols +- Added `not-swapped` flag to signal handlers, which may be needed for signal handlers that specify an object +- Added expression literals, which allow you to specify a Gtk.Expression property (as opposed to the existing expression support, which is for property bindings) + +## Changed +- The formatter adds trailing commas to lists (Alexey Yerin) +- The formatter removes trailing whitespace from comments (Alexey Yerin) +- Autocompleting a commonly translated property automatically adds the `_("")` syntax +- Marking a single-quoted string as translatable now generates a warning, since gettext does not recognize it when using the configuration recommended in the blueprint documentation + +## Fixed +- Added support for libgirepository-2.0 so that blueprint doesn't crash due to import conflicts on newer versions of PyGObject (Jordan Petridis) +- Fixed a bug when decompiling/porting files with enum values +- Fixed several issues where tests would fail with versions of GTK that added new deprecations +- Addressed a problem with the language server protocol in some editors (Luoyayu) +- Fixed an issue where the compiler would crash instead of reporting compiler errors +- Fixed a crash in the language server that occurred when a detailed signal (e.g. `notify::*`) was not complete +- The language server now properly implements the shutdown command, fixing support for some editors and improving robustness when restarting (Alexey Yerin) +- Marking a string in an array as translatable now generates an error, since it doesn't work +- + +## Documentation +- Added mention of `null` in the Literal Values section +- Add apps to Built with Blueprint section (Benedek Dévényi, Vladimir Vaskov) +- Corrected and updated many parts of the documentation + # v0.14.0 ## Added diff --git a/docs/flatpak.rst b/docs/flatpak.rst index 0071d2f..86112cf 100644 --- a/docs/flatpak.rst +++ b/docs/flatpak.rst @@ -17,7 +17,7 @@ a module in your flatpak manifest: { "type": "git", "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler", - "tag": "v0.14.0" + "tag": "v0.16.0" } ] } diff --git a/meson.build b/meson.build index 63d9489..f298d15 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('blueprint-compiler', - version: '0.14.0', + version: '0.16.0', ) prefix = get_option('prefix') From 404ae767870b6da6005f2f4aaa878deed82829e5 Mon Sep 17 00:00:00 2001 From: James Westman Date: Fri, 17 Jan 2025 17:25:21 -0600 Subject: [PATCH 5/5] Update MAINTENANCE.md --- MAINTENANCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 220c117..3ab4fa2 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -8,7 +8,7 @@ in the NEWS file. 3. Make a new commit with just these two changes. Use `Release v{version}` as the commit message. Tag the commit as `v{version}` and push the tag. 4. Create a "Post-release version bump" commit. 5. Go to the Releases page in GitLab and create a new release from the tag. -6. Announce the release through relevant channels (Twitter, TWIG, etc.) +6. Announce the release through relevant channels (Mastodon, TWIG, etc.) ## Related projects