Skip to content

Properties completions lose qualified-prefix ranking after dots #287

Description

@luceat-lux-vestra

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.port was response item 0 with sortText: "00000".
  • server.ssl.key-password was item 6 with sortText: "00006".
  • deprecated server.max-http-post-size was item 119 with sortText: "00119" and tags: [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

  1. Open a Spring Boot project's application.properties with Spring Tools completion available.
  2. Type server.p and trigger completion.
  3. Compare the visible ordering with the textDocument/completion response's sortText values.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions