Both the racket and scheme entries used the rkt file-extension. This
commit removes that entry for scheme and so that the racket entry takes
precedence. We explicitly point to the scheme grammar now and setup
queries that inherit from scheme. This should enable using the racket
language server configuration.
This update includes a handful of fixes, a new binary concatenation
operator (already highlighted by the `binary_operator` rule), and a
new `use` language construct. The nodes are backwards compatible but
this update introduces two new nodes for highlighting: `use` and `<-`.
This highlights edoc within Erlang comments. The trick was to have
the Erlang grammar consume newlines and then give them to EDoc in the
injection to use so that line-wise elements could be parsed accurately.
This adds in a couple more roots that are common in Scala.
- `build.sc` which is used in Mill
- `build.gradle` for Scala Gradle projects
- `.scala-build` for scala-cli projects
This PR makes the editor use language=bash when the shebang line uses
zsh. This is in the same line as using language=bash for zsh related
file (~/.zshrc, ~/.zshenv etc.) as we already do.
The change in d801a6693c to search for
suffixes in `file-types` is too permissive: files like the tutor or
`*.txt` files are now mistakenly interpreted as R or perl,
respectively.
This change changes the syntax for specifying a file-types entry that
matches by suffix:
```toml
file-types = [{ suffix = ".git/config" }]
```
And changes the file-type detection to first search for any non-suffix
patterns and then search for suffixes only with the file-types entries
marked explicitly as suffixes.
* feat(syntax): add strategy to associate file to language through pattern
File path will match if it ends with any of the file types provided in the config.
Also used this feature to add support for the .git/config and .ssh/config files
* Add /etc/ssh/ssh_config to languages.toml
* cargo xtask docgen
* Update languages.md
* Update languages.md
* Update book/src/languages.md
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* Update book/src/languages.md
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Marksman is an LSP server for Markdown: https://github.com/artempyanykh/marksman
It supports a bunch of LSP features: symbols, references, rename, diag,
etc. and already has integrations with emacs, neovim, and vscode.
Around 50 columns for the summary is good because it is often used as
heading or as subject in emails. 72 columns for the body is generally
good because some tools do not wrap long lines (`git log` with pager
`less` is a good example). Helix's `:reflow` command is really good to
help with the second point.
Linux kernel documentation says:
> For these reasons, the ``summary`` must be no more than 70-75
> characters, and it must describe both what the patch changes, as well
> as why the patch might be necessary. It is challenging to be both
> succinct and descriptive, but that is what a well-written summary
> should do.
Source:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n627
tpope:
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Commit message style guide for Git:
https://commit.style/
There don't appear to be any regressions from the updates.
Also included is a fix which highlights the "#" as in attributes
as punctuation. This was previously unhighlighted.
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`.
news:
- tree-sitter-elixir now powers Elixir syntax highlighting on github.com
- GitHub now supports code-navigation for Elixir repos via
tree-sitter-elixir
changes:
- modules now use the `@module` highlight, which was added upstream to
tree-sitter
- it seems appropriate to use `@namespace` to follow helix convention
- added nullary range operator (e.g. `Enum.to_list(..) == []`), a new syntax
for elixir 1.14
- a fix for stab clause nodes mis-highlighting when the right hand side of
the stab clause contained multiple simple expressions
changes:
- typed fields within records which do not declare a default
value are now correctly highlighted as record fields
- the EEP49 'maybe' form is now parsed
- fixes for highlights for 'begin' and 'after' tokens
changes:
- any text following a (scissors) is now contained in one (message)
- this vastly improves performance on large verbose commits:
no more slowness on huge commits