Commit Graph

24 Commits (f843967059fc36bf497bde31ce9ed18b1354f1eb)

Author SHA1 Message Date
Clay da8071047a
Elixir: update tree-sitter queries (#3645) 2 years ago
Clay b55573dc1d
Add elixir & heex comment textobjects (#3179) 2 years ago
Connor Lay (Clay) 67f6c85792 text-objects: add test capture & elixir queries 2 years ago
Michael Davis bcafdf404f add textobject queries for elixir 2 years ago
Clay fc8c488322
Elixir: inject Markdown into docs, remove h sigil HEEx injection (#2619)
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
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.
2 years ago
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.
2 years ago
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
2 years ago
Michael Davis a8fd33ac01
add tree-sitter-regex (#1362)
* 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
3 years ago
Michael Davis e72786df8e
Add tree-sitter-comment (#1300)
* Add tree-sitter-comment

Fix #1164

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