Commit graph

950 commits

Author SHA1 Message Date
Fymyte
d13c045223 add(rasi): add rasi parser
Signed-off-by: Fymyte <pierguill@gmail.com>
2022-01-05 01:01:12 +01:00
Rafik Draoui
9b262596e0 Remove Python docstring injections
These injections lead to inconsistent highlighting since some edge cases
aren't handled (as mentioned in the PR description that introduced the
injections [0]). Besides, not all Python projects use reStructuredText
syntax in docstrings.

If someone still wants to use them, they can extend the base injection
queries through `after/queries/` [1] or enable them with
`vim.treesitter.set_query`.

See also: https://github.com/nvim-treesitter/nvim-treesitter/pull/1204

[0]: https://github.com/nvim-treesitter/nvim-treesitter/pull/917
[1]: ad69e2528a (adding-queries)
2022-01-04 23:15:30 +01:00
Jirgn
8342a84f40 fix: typo in locals query 2022-01-04 00:59:33 +01:00
Jirgn
c3731d627e fix: add eel_array and eel_object to indent query 2022-01-04 00:59:33 +01:00
Jirgn
47e9c1dce9 fix: highlights for value_expression start and end as punctuation 2022-01-04 00:59:33 +01:00
Jirgn
a64f509beb feat: add indent for fusion and afx 2022-01-04 00:59:33 +01:00
Jirgn
8ec2b6cb9f fix: add afx_text to highlights (text) 2022-01-04 00:59:33 +01:00
Jirgn
88505b7312 feat: add more local definitions 2022-01-04 00:59:33 +01:00
Jirgn
17403ce019 feat: add fold queries 2022-01-04 00:59:33 +01:00
Philip Zander
fa2a6b68aa highlights(pascal): Highlight variables
Assume that any identifiers that aren't function calls, types, fields or
constants are variables. This is consistent with the highlighting
definitions for other languages. Some themes (e.g. zenbones) make use of
this information and they don't look quite right unless we set those
groups.
2021-12-29 23:38:43 +01:00
Isopod
9174b095b6
Add support for Pascal (#2153)
* Add support for Pascal

* Pascal: Replace some of the capture groups, use lua-match where possible
2021-12-24 13:53:32 -05:00
Santos Gallegos
b99f46c735 Query: update highlights
ref https://github.com/nvim-treesitter/tree-sitter-query/pull/17
2021-12-24 03:46:53 +01:00
Santos Gallegos
9025d96159 PHP: highlight unset
Similar to 57f855461a/grammar.js (L130-L132)

Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/2156
2021-12-23 21:02:51 +01:00
jirgn
6b5b37cc3e
update fusion to version 1.1.1 (#2148)
* feat(fusion): update tests

* fix(fusion): update lockfile

* fix(fusion): update to (highlight breaking) version 1.1.0

* update grammer to introduce afx support
* update tests and queries

* fix: revert lockfile update of unrelated grammars

* fix: update to 1.1.1 and fix hightlights

* fix: use @tag.attribute capture to match specs

Co-authored-by: Jirgn <jirgn76@googlemail.com>
2021-12-23 11:18:15 -05:00
Santos Gallegos
56634f49ab Update queries
- Don't use the old form for predicates
- Update some invalid queries
2021-12-22 21:17:28 +01:00
Santos Gallegos
6c5f4b1b49 Markdown: update queries 2021-12-21 01:07:22 +01:00
Michael Chris Lopez
c9db432435
highlights(markdown): separate highlight for header marker and underline (#2129) 2021-12-19 19:38:42 -05:00
Fabian
e01c7ce972
highlights(python): Improve self and cls highlight (#2134)
1. This function simplifies an unnecessary lua-match usage.
2. Fixes an accidental change, where "cls" was changed to "class" (fe4f320b66)
3. Match functions, which have have a decorator.
4. But exclude @staticmethod
5. Only highlight "cls" as @variable.builtin when the decorator is @classmethod

This might be a bit to complicated and some of this not to useful,
as this existing rule:

```scm
 ((identifier) @variable.builtin
  (#eq? @variable.builtin "self"))
```

overwrites the queries anyway.
2021-12-18 16:49:30 -05:00
Omer Tuchfeld
3b05ef4492 Add support for new golang go.work files
The new golang 1.18 version (currently in beta) [introduced](https://github.com/golang/go/issues/45713) a new file type
called `go.work`.

This commit adds support for the syntax of that file using the https://github.com/omertuc/tree-sitter-go-work repository
That repository is heavily based on previous work in the https://github.com/camdencheek/tree-sitter-go-mod repository, with a few
minor changes to make it work on the very similar `go.work` files.
2021-12-18 20:02:08 +01:00
Michael Chris Lopez
296c28be53 highlights(markdown): highlight link_text as @text.reference 2021-12-17 10:36:58 +01:00
lucy
be741e2568 highlights(bash): add [[ ]] 2021-12-14 19:31:21 +01:00
lucy
4871b2b440 highlights(bash): add process substitution 2021-12-14 19:31:21 +01:00
Stephan Seitz
387a8f38bd parsers: Add MDeiml/tree-sitter-markdown as markdown parser
Fixes #872
2021-12-14 15:00:14 +01:00
Lewis Russell
567c644e53 feat(lang): add make 2021-12-14 14:59:38 +01:00
Stephan Seitz
225cac5e6b injections(rust): inject regex into Regex::new 2021-12-14 14:28:26 +01:00
numToStr
63630ec082 highlights(lua): next as builtin function 2021-12-13 20:22:05 +01:00
Stephan Seitz
1bbc761acc highlights(ecma): highlight escape_sequence 2021-12-12 02:43:08 +01:00
Jirgn
f51aa0b75e feat(fusion): update tests 2021-12-06 21:51:53 +01:00
Stephan Seitz
e6eeda7da9 rust(highlights): fix highlighting of char_literal 2021-12-06 21:20:58 +01:00
Dawid Zych
d6a0a26b85 OCaml string format specifiers
For format specifiers use @string.special instead of
@punctuation.special.
2021-12-02 16:56:58 +01:00
silenc3r
acf0c0f6a1 OCaml use @constant.builtin for built in constants 2021-12-01 19:38:36 +01:00
Stephan Seitz
675ecbb0bd Fix pug injection 2021-11-30 23:40:49 +01:00
Stefan Wienert
dec2ba27a8 Feat: Added Pug parser with inital queries 2021-11-30 23:40:49 +01:00
Steve Occhipinti
c6b90ee9bd Handle .attrs() cases
Now that there are 4 cases handled, I thought it probably needs some comments to
show which case each injection is for.

There are other unsupported cases, such as `.withConfig` but I'm not sure if
they all belong here or into their own plugin or something.

The API reference is available here:
https://styled-components.com/docs/api

Also, not sure if there is a more generic way of handling all these cases at
once, a rule that would read: "any template string descendant from 'styled'".

Will attempt to open a PR and get some advice.
2021-11-28 15:02:55 +01:00
Steve Occhipinti
6240dae0e4 Support both styled.div and styled(Component)
This new injection caters for code like this:

```
const IntroWindow = styled(Window)`
  grid-area: intro;
`
```
2021-11-28 15:02:55 +01:00
Steve Occhipinti
058e050315 Add a basic styled-components injection
I've never written this sort of code before but I was able to get this to work
with the help of copy and paste and using nvim-treesitter/playground.

I had a hard time trying to understand how to indent this style of code so I let
vim do it with `=` and 2 spaces seems to match other files I looked at.

This works for a basic example, like this:

```
const Layout = styled.div`
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 100px 1fr 3rem;
`
```
2021-11-28 15:02:55 +01:00
Stephan Seitz
b5d05aaac8 yaml(injections): Also add heuristics for Gitlab CI bash 2021-11-28 15:01:34 +01:00
Stephan Seitz
ad615ffc4c injections(yaml): inject bash on key "run" 2021-11-28 15:01:34 +01:00
Stephan Seitz
28cc92a2f6 highlights(bash): highlight "((" "))" 2021-11-28 15:01:24 +01:00
Stephan Seitz
4b21803fb5 highlights(elm): apply review comments 2021-11-28 00:45:02 +01:00
kiyan
cd987a44f0 feat(elm): add first elm highlight 2021-11-28 00:45:02 +01:00
elianiva
5e388a40bc feat(prisma): add ftdetect 2021-11-28 00:36:24 +01:00
elianiva
c5d7aa36e4 fix(prisma): propert @type highlighting 2021-11-28 00:36:24 +01:00
elianiva
2507f890ac refactor(prisma): group similar nodes 2021-11-28 00:36:24 +01:00
elianiva
b2801abc21 refactor(prisma): switch to alternative repo
Co-authored-by: richin13 <richin13@gmail.com>
2021-11-28 00:36:24 +01:00
elianiva
3da2ab9857 feat: add prisma support 2021-11-28 00:36:24 +01:00
maxxnino
50314758ee zig: work around for hang neovim 2021-11-28 00:25:25 +01:00
Stephan Seitz
61b21254ee parsers(fusion): add info about main branch 2021-11-26 22:04:59 +01:00
Jirgn
096f0e91be fix: incorrect hightlight groups 2021-11-26 22:04:59 +01:00
Jirgn
a0ad73493e fix: typo in highlight group punct(u)ation 2021-11-26 22:04:59 +01:00