mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 23:04:27 +00:00
Follow-up to https://github.com/zed-industries/zed/pull/41111. PR #41111 introduced combined injection handling, but cursor language queries still relied on layer range selection alone. For combined injections this can surface a language from the outer combined layer even when the cursor is outside that language's actual included sub-range. So, we just need to add sub-range filtering based on anchor-aware boundary checks in the same way we did in the previous PR. That means: apply it in `Buffer::language_at`, `Buffer::languages_at`, and `BufferSnapshot::language_scope_at`. All places that rely on the described behavior. I also added some additional test cases for the `HTML+ERB` lang to verify language resolution for HTML and Ruby positions. Thank you! Closes https://github.com/zed-industries/zed/issues/48358 Release Notes: - Respect combined injection sub-ranges for language queries |
||
|---|---|---|
| .. | ||
| buffer | ||
| syntax_map | ||
| buffer.rs | ||
| buffer_tests.rs | ||
| diagnostic_set.rs | ||
| highlight_map.rs | ||
| language.rs | ||
| language_registry.rs | ||
| language_settings.rs | ||
| manifest.rs | ||
| outline.rs | ||
| proto.rs | ||
| syntax_map.rs | ||
| task_context.rs | ||
| text_diff.rs | ||
| toolchain.rs | ||