Repository navigation
Description
What happened?
Spring Boot property completions in .properties files are re-ranked against only the text after the last dot. For example, at server.p, Zed uses p as its local fuzzy query because the Properties language configuration does not declare . as a completion_query_character.
This can override the language server's deliberate sortText ranking. In a captured Spring Tools 5.2.0 completion response for server.p:
server.portwas response item 0 withsortText: "00000".server.ssl.key-passwordwas item 6 withsortText: "00006".- deprecated
server.max-http-post-sizewas item 119 withsortText: "00119"andtags: [1].
The visible Zed menu instead began with server.ssl.key-password, deprecated server.max-http-post-size, and several Tomcat max-part properties. server.port was not in the visible beginning.
Reproduction
- Open a Spring Boot project's
application.propertieswith Spring Tools completion available. - Type
server.pand trigger completion. - Compare the visible ordering with the
textDocument/completionresponse'ssortTextvalues.
Source-backed cause
The current Properties config has no completion query characters:
name = "Properties"
grammar = "properties"
path_suffixes = ["properties"]
line_comments = ["# "]
brackets = [{ start = "[", end = "]", close = true, newline = true }]Zed's completion query is the surrounding word under this language configuration, so . is punctuation and the query at server.p becomes p. Zed then ranks fuzzy score and match positions before LSP sortText.
I reproduced the sorter behavior on current zed-industries/zed main (2118a7c53a843b791adff6c21b0a4ca0de8478b9) using the captured labels/filter text/sort text:
p: ["server.ssl.key-password", "server.max-http-post-size", "server.tomcat.max-part-count", "server.tomcat.max-parameter-count", "server.tomcat.max-part-header-size", "server.port"]
server.p: ["server.port", "server.ssl.key-password", "server.max-http-post-size", "server.tomcat.max-part-count", "server.tomcat.max-parameter-count", "server.tomcat.max-part-header-size"]
This shows that including the dot in the query restores server.port to first place for this captured subset without changing Zed's global sorter.
Expected behavior / candidate fix
Properties completion should retain the qualified key prefix while filtering. The narrow candidate is:
completion_query_characters = [".", "-"]. is directly verified by the sorter reproduction above. - should be covered as part of the same change because Spring property segments commonly use kebab case, but it still needs runtime coverage for relaxed binding aliases before merge.
Environment
- Zed 1.11.3 (
952d712dac48a4af2c54fb22c82d82a9d69b72d4) - Java extension 6.8.23 (
ddc13dafaf9ddc44ab46c9ff9768832aa98dfe11) - Spring Tools 5.2.0.RELEASE (
18d1a975dbea4f9314fd736d0237bd9e23f243f9) - macOS 26.5.2 arm64
- Temurin JDK 25.0.3
Full source attribution and bounded runtime observations are recorded in R015.
Activity
tartarughina commentedon Jul 19, 2026
@luceat-lux-vestra thanks for the detailed report and for the suggested fix.
The completion characters are usually provided by the languages server. See below how JDTLS informs Zed of those in the initial handshake communication.
I'd first try to see whether your language server could tell Zed about these trigger characters before adding an override to
properties.Snippet below is following what the Ruby extension does: see
luceat-lux-vestra commentedon Jul 19, 2026
Thanks @tartarughina — the Ruby snippet you linked is exactly the shape of fix I had in mind. But I want to flag one thing on the "see whether the language server could tell Zed about these trigger characters first" suggestion, because I think it points at a different mechanism than the one causing the bad ranking. I checked this against current Zed source (
2ed83a1ee6).triggerCharactersandcompletion_query_charactersare two independent code paths in Zed:triggerCharacters(server-advertised, your JDTLS handshake snippet) only decide when Zed fires atextDocument/completionrequest and what trigger context it attaches. They are consumed atcrates/editor/src/completions.rs:446-460purely to build the request'strigger_kind/trigger_character— they never feed the local filtering/ranking.completion_query_characters(the languageconfig.tomlfield, which is what the Ruby[overrides.string]snippet sets) is what decides the query word Zed extracts to fuzzy-rank the returned items. That word comes solely fromcompletion_query()→surrounding_word(offset, Some(CharScopeContext::Completion))(completions.rs:758), which reads the language'scompletion_query_characters(language.rs:1259,buffer.rs:6148).So a server advertising
.as a trigger character — even this exact JDTLS list — will not change the ordering. Atserver.p,.is still not a query character, the local query collapses top, and Zed's fuzzy score is applied ahead of the server'ssortText(server.portships assortText: "00000"but drops out of the visible top). Onlycompletion_query_charactersmoves that boundary.Two more reasons the server-trigger route doesn't cover this case:
["." , "@", "#", "*", " "]is JDTLS advertising for.java. These particular completions come from the Spring Tools language server over.properties— a different server and document than the Java handshake shown.(space),*, and@would break word boundaries if promoted intocompletion_query_characters.So I believe the
completion_query_charactersoverride you pointed at (the Ruby pattern) is the correct and narrowest fix — adding[".", "-"]for the Properties language. Happy to open a PR with a fixture that assertsserver.p,server.tomcat.m, and one deprecated property, if that direction works for you.tartarughina commentedon Jul 19, 2026
@luceat-lux-vestra please, as you seem to have more insights on the specific issue, go ahead and create the pull request.
One small note from my side, the override should probably be applied to property rather than string but I could be wrong.
fix(properties): scope completion query characters to property nodes (z…