JavaScript queries now contain a few lines that prevent them from
being used whole-sale in typescript with `; inherits: javascript`.
Here we follow nvim-treesitter's way of using a fake 'ecma' language
as a common base for JavaScript and TypeScript to share as much as
we can.
Some lines went longer than the titlebars, fixed regex in
SPLITTING SELECTIONS which wasn't actually correct.
Changed 1 "bat" to a "cat" in ADDING SELECTION ON NEXT
SEARCH MATCH which makes it harder to do with a simple
s select.
The fix comes from the rewriting of the `closure_parameters` stanza:
it was capturing the entire `closure_parameters` node including
paretheses, whitespace, and commas. Capturing the identifiers within
fixes the tracking.
In order to make sure locals definitions from closure parameters don't
leak out of the body of the closure, though, we should also mark the
closure itself as a locals scope.
A few changes to make TSQ highlights better:
* A parsing error has been fixed in the grammar itself
* Previously tree-sitter-tsq did not parse the variables
in predicates like `(#set! injection.language "javascript")`
* Theme nodes as `tag`
* The newly added node to the parser (from the above fix) is
`variable` which takes over the `variable` capture from nodes
* Highlight known predicates as `function` and unsupported
predicates as `error`
* This may help when translating queries from nvim-treesitter.
For example `#any-of?` is a common one used in nvim-treesitter
queries but not implemented in Helix or tree-sitter-cli.
* Inject tree-sitter-regex into `#match?` predicates
- Misspelling of 'modifiers' for markdown.heading.1 and 2.
- Errors are now just underlined instead of in red.
- Diagnostics are dimmed, as well as whitespace.
- Add constant.builtin.
You might use a macro like `?MODULE` to name a record:
-record(?MODULE, {a, b, c}).
With this fix, the record fields correctly get `variable.other.member`
highlights.
* branch message with current branch and diverged branch has been
added to the parser
* scissors used in verbose commits are marked as a punctuation
delimiter
* we could use comment instead since they're visually the
same but IMO this works better
Punctuation highlights would show up outside of where they
were valid, for example using parentheses in some text. This
change prevents that by gating the captures to being under
the named nodes in which they are valid.
* add punctuation highlights for commas as in function parameters
* remove stray `variable.parameter` highlight
* I couldn't find any regressions from this and it fixes an
edge case I ran into (but sadly did not record 😓)
* highlight `fn` as `keyword.function`
* the theme docs have `fn` as an example so it seems fitting
The '#' character may either be interpreted as a map when used
like so:
%% Example 1
#{a => b}
Or as an operator which updates an existing map when the left-hand
side is an expression:
%% Example 2
MyMap#{a => b}
This commit changes the highlight to `punctuation.bracket` when used
as a character in a literal map (example 1) and keeps the `operator`
highlight when used for updating (example 2).
* Add mode specific styles
In similar vein to neovim's lualine and similar statusline packages this
allows helix users to style their mode based on which mode it is thus
making each mode more visually distinct at a glance
* Add an example based on rosepine
* Add editor.colors-mode config
* Document statusline mode styles