ZIm/crates/language/src
Smit Barmase 9ee5dd7568
editor: Fix double $ sign on completion accept in PHP (#34726)
Closes #33510 https://github.com/zed-extensions/php/issues/29

If certain language servers do not provide an insert/replace range, we
use `surrounding_word` as a fallback for that range, which internally
uses `word_characters`. It makes sense to use
`completion_query_characters` instead of `word_characters` to get that
range, because we use `completion_query_characters` to query completions
in the first place.

That means, for some hypothetical reason (e.g., if the Tailwind server
stops providing insert/replace ranges), we would correctly fall back to
the range "bg-blue-200^" instead of "200^", because
`completion_query_characters` includes "-" in this case.

For this particular fix, right now the default PHP language server
`phpactor` does not provide an insert/replace range, and hence
completion query character is used, which is `$` in this case.

Note that `$` isn't in word characters for reasons mentioned here:
https://github.com/zed-extensions/php/issues/14

Release Notes:

- Fixed an issue where accepting variable completion in PHP would result
in a double $ sign in the prefix.
2025-08-23 10:35:20 -04:00
..
syntax_map Add a test demonstrating ERB language loading bug (#32278) 2025-06-11 04:03:42 +00:00
buffer.rs editor: Fix double $ sign on completion accept in PHP (#34726) 2025-08-23 10:35:20 -04:00
buffer_tests.rs Migrate to schemars version 1.0 (#33635) 2025-06-30 21:07:28 +00:00
diagnostic_set.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
highlight_map.rs Docs for indent_size_for_line and co 2024-01-09 20:50:34 +01:00
language.rs editor: Improve rewrap of markdown lists, todos, and block quotes (#33702) 2025-07-01 15:34:39 +05:30
language_registry.rs Remove remaining plugin-related language server adapters (#34334) 2025-07-12 11:42:14 +00:00
language_settings.rs Default `#[schemars(deny_unknown_fields)] for json-language-server schemas (#33883) 2025-07-04 00:57:43 +00:00
manifest.rs python: Re-land usage of source file path in toolchain picker (#31893) 2025-06-02 16:29:06 +00:00
outline.rs editor: Improve code completion filtering to provide fewer and more accurate suggestions (#32928) 2025-06-18 16:01:28 +05:30
proto.rs Show inline previews for LSP document colors (#32816) 2025-06-17 13:46:21 +00:00
syntax_map.rs Diff view (#32922) 2025-06-18 14:43:23 +00:00
task_context.rs Add initial package.json scripts task autodetection (#32497) 2025-06-10 22:16:27 +00:00
text_diff.rs agent: Improve Gemini support in the edit_file tool (#31116) 2025-05-22 12:01:43 +03:00
toolchain.rs python: Re-land usage of source file path in toolchain picker (#31893) 2025-06-02 16:29:06 +00:00