The update fixes a bug that caused the external scanner to hang during
error recovery.
Looking at the diff, there are no structural changes in this update.
There are a few new fields and it looks like some edge-case fixes
but nothing that breaks compatibility with the current queries.
* Change default formatter for any language
* Fix clippy error
* Close stdin for Stdio formatters
* Better indentation and pattern matching
* Return Result<Option<...>> for fn format instead of Option
* Remove unwrap for stdin
* Handle FormatterErrors instead of Result<Option<...>>
* Use Transaction instead of LspFormatting
* Use Transaction directly in Document::format
* Perform stdin type formatting asynchronously
* Rename formatter.type values to kebab-case
* Debug format for displaying io::ErrorKind (msrv fix)
* Solve conflict?
* Use only stdio type formatters
* Remove FormatterType enum
* Remove old comment
* Check if the formatter exited correctly
* Add formatter configuration to the book
* Avoid allocations when writing to stdin and formatting errors
* Remove unused import
Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
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
* 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
This includes a fix for the new HTML highlights introduced a few
parent commits back:
["\"" (attribute_name)] @string
Would get tripped up and the entire line would be highlighted as
a string. Now `\"` is a valid escape.
I'm switching to my fork as the primary repo as the upstream hasn't
been touched in over a year (mostly because stability afaict) but
it has no watchers currently so I'm not hopeful that my PR will
be merged.
The update to the grammar itself covers the case where the document
is a single expression without a trailing newline such as "min(A, B)".
A small change to the parser now parses these expressions correctly
which improves the display of the function head in the signature
help popup.
The update to the queries marks 'andalso', 'orelse', 'not', etc. as
`@keyword.operator` which improves the look - it looks odd to see
operators that are words highlighted the same as tokens like '->'
or '=:='.
* Added a default lsp server for Java in languages.toml
* Added a default lsp server for Java in languages.toml cont.
Co-authored-by: Jacob Thompson <a01657923@usu.edu>
HEEx is a templating engine on top of Elixir's EEx templating
language specific to HTML that is included in Phoenix.LiveView
(though I think the plan is to eventually include it in base
Phoenix). It's a superset of EEx with some additional features
like components and slots.
The injections don't work perfectly because the Elixir grammar is
newline sensitive (the _terminator rule). See
https://github.com/elixir-lang/tree-sitter-elixir/issues/24
for more information.
The new revision handles a case that I come across often: a stab
clause (i.e. '->') with an empty right hand side:
Enum.map(xs, fn x ->
end)
The old version would parse the "end" token as an error.
This is technically valid syntax but more importantly it comes up
very often when editing, and the old revision would flicker between
the keyword highlight and the warning highlight.
After the incremental parsing rewrite for injections (which was released
in 22.03 https://helix-editor.com/news/release-22-03-highlights/#incremental-injection-parsing-rewrite),
we can now do combined injections which lets us pull in some templating
grammars. The most notable of those is embedded-template - a pretty
straightforward grammar that covers ERB and EJS.
The grammar and highlights queries are shared between the two but they have
different injections.
It looks like a24fb17b2a (and
855e438f55) broke the typescript
highlights because typescript
; inherits: javascript
but it doesn't have those named nodes in its grammar.
So instead we can separate out JSX into its own language and copy
over everything from javascript and supplement it with the new
JSX highlights. Luckily there isn't too much duplication, just the
language configuration parts - we can re-use the parser with the
languages.toml `grammar` key and most of the queries with `inherits`.