From 20c5a9b5b8da38b6b60022dcdf005940ac82bea4 Mon Sep 17 00:00:00 2001 From: luceat-lux-vestra Date: Mon, 20 Jul 2026 23:49:39 +0900 Subject: [PATCH] fix(properties): scope completion query chars to property nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typing a dotted key such as `server.p` ranked unrelated deeper keys above `server.port`, because Zed built its fuzzy query from the surrounding word only, and `.` was not a word character for Properties. The query collapsed to `p`, so the server's `sortText` ordering was discarded and the exact prefix match dropped out of the visible list. Declare `completion_query_characters` for the Properties language so the query is the whole dotted key. The setting only takes effect through an override scope, so add the matching `overrides.scm`. The capture must be `.inclusive`: a key is typed left-to-right, so the cursor sits at the end offset of the `property` node, and Zed's `SyntaxLayer::override_id` excludes that offset for non-inclusive captures. Verified in Zed 1.11.3 against a Spring Boot project — with a plain `@property` capture the query stays `p` and `server.port` is absent from the menu; with `@property.inclusive` the query becomes `server.p` and `server.port` ranks first. Fixes #287 --- languages/properties/config.toml | 3 +++ languages/properties/overrides.scm | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 languages/properties/overrides.scm diff --git a/languages/properties/config.toml b/languages/properties/config.toml index 9537eef..96ad1a1 100644 --- a/languages/properties/config.toml +++ b/languages/properties/config.toml @@ -3,3 +3,6 @@ grammar = "properties" path_suffixes = ["properties"] line_comments = ["# "] brackets = [{ start = "[", end = "]", close = true, newline = true }] + +[overrides.property] +completion_query_characters = [".", "-"] diff --git a/languages/properties/overrides.scm b/languages/properties/overrides.scm new file mode 100644 index 0000000..3615ee5 --- /dev/null +++ b/languages/properties/overrides.scm @@ -0,0 +1,4 @@ +; Property keys are typed left-to-right, so the cursor sits at the end of the +; node; a non-inclusive capture would exclude that offset (see Zed's +; SyntaxLayer::override_id) and the override would never apply while typing. +(property) @property.inclusive