pulsar/packages/language-rust-bundled
Andrew Dupont adfdd05472 Allow “half-covering” of scopes at the edges of injections
There's a hard-to-grok setting for language injections that allows a deeper layer to monopolize the scope application for a range. In most cases, an injection is placed into a node that the parser doesn't know much about (like a `script` block in HTML); but Rust and C parsers needed a way to inject themselves _into themselves_ so that they could add syntax highlighting to macros. Because they were applying highlighting to a range that the base layer _already_ had plans to highlight, they needed a way to block the shallower layer from acting.

This mode has never worked briliantly, but it's been made smarter in several ways since the invention of modern Tree-sitter. And here's another one: if the highlight iterator is at a position where an injection range is _about_ to begin, it shouldn't be able to stop any other layer from _closing_ a scope; and if the highlight iterator is at a position where an injection range has just _finished_, it shouldn't be able to stop any other layer from _opening_ a scope.

Because of this, we can now fix a bug that I think might've been present for a while in the application of scopes to rust macros like `println!` — the position after the exclamation point is one of those injection-layer boundaries, to the effect that a scope name was opened that would persist until at least the end of the screen line.
2024-01-27 00:41:41 -08:00
..
grammars Allow “half-covering” of scopes at the edges of injections 2024-01-27 00:41:41 -08:00
lib Convert all modern Tree-sitter TODO/hyperlink injections into services 2024-01-18 13:53:22 -08:00
settings Provide built-in rust support using Tree-sitter 2018-10-17 19:30:21 -07:00
package-lock.json add or update packages/*/package-lock.json 2022-12-10 19:13:50 +01:00
package.json Convert all modern Tree-sitter TODO/hyperlink injections into services 2024-01-18 13:53:22 -08:00
README.md Add language-rust-bundled to packages/README.md 2018-10-19 10:19:40 -07:00

language-rust-bundled

This package provides Rust syntax highlighting in Atom based on syntax trees provided by tree-sitter-rust.