Consider the colon to be a word character when inside a string in JSON (#26574)

Partially addresses #25698

Part of why autocomplete suggestions for `keymap.json` aren't great is
because `:` is (correctly) considered a punctuation character, rather
than a word character, in JSON. But since `::` is part of the name of
zed commands, it means that the autocomplete context window loses
context after the user types colon:

Suggestion here is to use overrides for JSON and JSONC such that colon
is considered a word character when it's inside a string. This improves
the experience:

I believe this is more broadly correct anyway, since `:` loses it's
punctuation meaning when inside a string.

Hope this is helpful!

Release Notes:

- Improved autocomplete for keymap.json by treating `::` like word characters when inside a string.
This commit is contained in:
KyleBarton 2025-03-13 13:21:34 -07:00 committed by GitHub
parent a7f3b22051
commit 6bdd2cf7db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -10,3 +10,8 @@ brackets = [
]
tab_size = 2
prettier_parser_name = "json"
scope_opt_in_language_servers = ["json-language-server"]
[overrides.string]
word_characters = [":"]
opt_into_language_servers = ["json-language-server"]

View file

@ -10,3 +10,8 @@ brackets = [
]
tab_size = 2
prettier_parser_name = "jsonc"
scope_opt_in_language_servers = ["json-language-server"]
[overrides.string]
word_characters = [":"]
opt_into_language_servers = ["json-language-server"]