Commit Graph

24 Commits (5f4f171b73232e5ec5e4b7153084a93033ab5cf0)

Author SHA1 Message Date
Clay da8071047a
Elixir: update tree-sitter queries ()
Clay b55573dc1d
Add elixir & heex comment textobjects ()
Connor Lay (Clay) 67f6c85792 text-objects: add test capture & elixir queries
Michael Davis bcafdf404f add textobject queries for elixir
Clay fc8c488322
Elixir: inject Markdown into docs, remove h sigil HEEx injection ()
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Michael Davis 4836bb38d3 add tree-sitter-heex
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.
Michael Davis 4ac94a5c43 remove error highlighting for tree-sitter-elixir
This will become more important with the HEEx grammar being added.
Error highlighting with the Elixir grammar is a bit jumpy because
in some scenarios, a bit of missing syntax can force tree-sitter to
give up on error recovery and mark the entire tree as an error.
This ends up looking bad when editing. We don't typically highlight
error nodes so I'm inclined to leave it out of the highlights here.
Michael Davis 1819478940 update tree-sitter-elixir
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
Michael Davis a8fd33ac01
add tree-sitter-regex ()
* add tree-sitter-regex

* adapt regex highlights from upstream

* inject regex into elixir sigil_r/2 and sigil_R/2

* generate lang-support docs

* capture interesting nodes in character-ranges

* make $.character_class captures more consistent

* fix fallthrough behavior for character classes

* capture pattern characters as 'string'

* use latest tree-sitter-regex

* set elixir regex injections as combined

* add link to upstream queries

* inject regex in rust into 'Regex::new' raw string literals
Michael Davis e72786df8e
Add tree-sitter-comment ()
* Add tree-sitter-comment

Fix 

* fix precedence in tree-sitter-comment highlights

connects https://github.com/helix-editor/helix/pull/1170

* set injection-regex for comment language

* remove comment filetype

* fix comment injections for neovim-style injections tags

* add comment injections for elixir

* remove f.comment

* fix spacing in .gitmodules

* run 'cargo xtask docgen'

Co-authored-by: Ivan Tham <pickfire@riseup.net>
Kirawi ee889aaa85
Updated tree-sitter query scopes ()
* updated theme scopes

variable.property -> variable.field
property -> variable.field

* updated theme scopes

* update book and themes

updated book and themes to reflect scope changes

* wip

* update more queries

* update dark_plus.toml
Michael Davis 7e6ade9290 fix: string.regex{=>p}
Michael Davis bf20e51044 use punctuation.special for interpolation #{ }
Michael Davis 4d8eb09b7c
scope arities in captures as operators
Michael Davis 80b54f2f69
use special.string.symbol instead of symbol
this aligns better with how ruby highlights symbols
Michael Davis 8f658f0dce
use latest tree-sitter-elixir with 'not in' query support
connects https://github.com/elixir-lang/tree-sitter-elixir/issues/9
Michael Davis 4771cc7ee4
align highlight scopes with documented scopes
Michael Davis c502cafecc
highlight calls to erlang modules as types
connects https://github.com/elixir-lang/tree-sitter-elixir/pull/5
Michael Davis b2655a7f5c
add LICENSE snippet at elixir hightlights top
Michael Davis 95ab40d171
use the warning type for tree-sitter ERRORs
Michael Davis 5db248cc1c
describe atoms as tags
Michael Davis d1b434d230
add highlights query from elixir-lang/tree-sitter-elixir
Corey Powell 35feb614b6 Updated elixir queries to fix crash
Corey Powell ca042a4bde Added elixir syntax
Using custom fork for now to get around generating the source files