helix/helix-term
Timothy DeHerrera 9c6c63a2be
inject language based on file extension & shebang (#3970)
* inject language based on file extension

Nodes can now be captured with "injection.filename". If this capture
contains a valid file extension known to Helix, then the content will
be highlighted as that language.

* inject language by shebang

Nodes can now be captured with "injection.shebang". If this capture
contains a valid shebang line known to Helix, then the content will
be highlighted as the language the shebang calls for.

* add documentation for language injection

* nix: fix highlights

The `@` is now highlighted properly on either side of the function arg.

Also, extending the phases with `buildPhase = prev.buildPhase + ''''`
is now highlighted properly.

Fix highlighting of `''$` style escapes (requires tree-sitter-nix bump)

Fix `inherit` highlighting.

* simplify injection_for_match

Split out injection pair logic into its own method to make the overall
flow easier to follow.

Also transform the top-level function into a method on a
HighlightConfiguration.

* markdown: add shebang injection query
2023-04-28 18:21:34 +09:00
..
src inject language based on file extension & shebang (#3970) 2023-04-28 18:21:34 +09:00
tests Fix typos (#6643) 2023-04-07 23:10:38 +08:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
build.rs feat(lsp): pass client_info on initialization (#4904) 2022-12-08 21:57:03 -06:00
Cargo.toml build(deps): bump libc from 0.2.141 to 0.2.142 (#6872) 2023-04-25 11:51:43 +09:00