Files
oak-gpui/crates
Ben Kunkle a40ee74a1f Improve handling of injection.combined injections in SyntaxSnapshot::layers_for_range (#32145)
Closes #27596

The problem in this case was incorrect identification of which language
(layer) contains the selection.

Language layer selection incorrectly assumed that the deepest
`SyntaxLayer` containing a range was the most specific. This worked for
Markdown (base document + injected subtrees) but failed for PHP, where
`injection.combined` injections are used to make HTML logically function
as the base layer, despite being at a greater depth in the layer stack.
This caused HTML to be incorrectly identified as the most specific
language for PHP ranges.

The solution is to track included sub-ranges for syntax layers and
filter out layers that don't contain a sub-range covering the desired
range. The top-level layer is never filtered to ensure gaps between
sibling nodes always have a fallback language, as the top-level layer is
likely more correct than the default language settings.

Release Notes:

- Fixed an issue in PHP where PHP language settings would be
occasionally overridden by HTML language settings
2025-06-06 10:47:28 -04:00
..
2025-06-06 16:18:05 +03:00
2025-06-05 12:59:22 +00:00
2025-06-06 12:05:27 +00:00
2025-06-06 08:31:59 -04:00
2025-06-02 21:24:08 +00:00
2025-06-06 16:18:05 +03:00
2025-06-06 16:18:05 +03:00
2025-05-01 19:24:14 +00:00
2025-05-29 15:20:58 -04:00