Commit graph

61 commits

Author SHA1 Message Date
Amaan Qureshi
964dc882e9 Partially Revert "fix(ecma): properly capture constants in const declarations"
This partially reverts commit c553e6c560.
2023-03-10 02:38:36 -05:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
c553e6c560 fix(ecma): properly capture constants in const declarations 2023-03-04 05:00:39 -05:00
Amaan Qureshi
33ba346e60 feat!: add @keyword.coroutine capture 2023-03-03 07:07:52 -08:00
Benny Powers
8d2f9903f1 feat(ecma): include outerHTML and innerHTML 2023-02-25 11:17:13 -05:00
Benny Powers
248a87ef65 feat(ecma): add innerHTML injection 2023-02-25 11:17:13 -05:00
ObserverOfTime
0e6d4b4172 highlights(ecma): limit constructor highlight 2023-02-03 14:32:28 -08:00
Pham Huy Hoang
2cd89b4bc3 fix(jsx): add missing indent end mark to elements 2023-01-04 12:14:03 +01:00
Raymond Ha
6c4772f7b6 indents(ecma): Fix switch default indent 2022-12-07 18:05:33 +01:00
Stephan Seitz
d6a2ecb8b7 highlights: create subscoping for ternary operator
After https://github.com/nvim-treesitter/nvim-treesitter/issues/470,
we decided to use `@conditional` for ternary operator instead of
operator despite `@conditional` is documented for keywords only.
A sub-scoping can make it easier for people to highlight this operator
group differently.

Also unify the usage of `@conditional...` across languages.
2022-12-02 21:42:11 +01:00
ObserverOfTime
fa4b9941e6 highlights(ecma): fix captures
Co-Authored-By: Stephan Seitz <stephan.seitz@fau.de>
2022-11-26 13:17:51 +02:00
Raymond Ha
faf78ce12a Narrow as @include query 2022-11-25 00:34:25 +01:00
Trard
cc2268e1c7 highlights(ecma): distinguish between "default" in export and switch statements 2022-11-24 21:55:50 +01:00
Trard
bbe90e9318 removed switch from keywords 2022-11-21 10:23:28 +01:00
NullVoxPopuli
c945b34179 Update ecma injections to support recent additions to tree-sitter-javascript/typescript 2022-10-24 14:27:14 -07:00
Munif Tanjim
63d7e456ea highlights(ecma): add pair_pattern punctuation.delimiter 2022-10-17 14:37:36 -07:00
ObserverOfTime
9b43ab819c highlights: use @preproc where appropriate 2022-10-15 08:49:01 -07:00
Lewis Russell
37398c7d68 feat(spell): support more languages 2022-09-26 13:47:12 +01:00
Nick Friday
ba752cee13 fix(ecma injections): jsdoc match /** */ only 2022-09-15 15:41:18 -07:00
Stephan Seitz
f66a911a95 highlights(ecma): use @method.call/function.call 2022-09-11 04:16:06 -07:00
Stephan Seitz
00b4ef5759 indents(ecma): make "]" @indent_end
Fixes #3382
2022-09-10 12:59:21 -07:00
Sergio Alejandro Vargas
fb6d60c7b9 highlights(ecma): Update queries for literals
- Add queries for value properties:
    - undefined
    - NaN
    - Infinity
- Highlight regex delimiters as brackets instead of punctuation
- Format queries for literals
2022-08-22 15:51:08 -07:00
GitHub
9dd1065ebe highlights(javascript): "?." -> optional_chain 2022-08-20 10:42:19 +02:00
Kiyan
6f3fbb2622
fix(ecma): indent end for bracket (#3121) 2022-07-07 14:35:12 +02:00
Jackson Ludwig
b39840302c
injections(ecma): add injection for commented graphql template strings (#2987) 2022-06-05 11:50:48 +02:00
William Mathewson
57f4dbd47b Use @definition.function for method & func definitions 2022-05-14 20:35:09 +02:00
William Mathewson
81dd6c988c Add method to definitions in ECMA locals
In Telescope, function declarations were being exposed in the selector,
but not method definitions which are also a form of function
declaration.
2022-05-14 20:35:09 +02:00
Stephan Seitz
bda4b35f76 indents(ecma): use auto indent on (ERROR)
Fixes #2515
2022-04-04 09:03:30 +02:00
Munif Tanjim
3ef2c77e13 fix(indent): ecma - parenthesized expression indentation 2022-02-26 15:44:37 +01:00
Munif Tanjim
20168d8e20 fix(indent): ecma - class method indentation 2022-02-26 15:44:11 +01:00
Munif Tanjim
7a6d93ca5b feat(indent): ecma - support common use-cases 2022-01-21 16:40:36 +01:00
Munif Tanjim
8f9d4ada35 feat(indent): ecma - support try_catch and if_else 2022-01-21 16:40:36 +01:00
Stephan Seitz
1bbc761acc highlights(ecma): highlight escape_sequence 2021-12-12 02:43:08 +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
numToStr
801c7f0b48 ecma: highlight private properties and methods 2021-11-25 15:42:24 +01:00
Lewis Russell
011ac894ec Prefer lua-match over match
as string.find is much quicker than vim.regex:match*
2021-11-23 10:02:06 +01:00
kiyan
3b533422df fix: remove priority in ecma template substitution hl
This PR removes the priority override for the interpolation because it
overrides every ecma based template literal, setting none with a higher
priority than ecma groups which made every template string look
`un`highlighted.
2021-10-03 11:01:30 +02:00
Santos Gallegos
8b7f70d366 Ecma: increase priority of template_substitution
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1688
2021-09-17 22:08:12 +02:00
delphinus
331b47d246 Use the color of variable 2021-09-09 23:00:05 +02:00
delphinus
398ec42d30 Set property color for destructuring assignment 2021-09-09 23:00:05 +02:00
delphinus
2156a55efa Enable to highlight shebang on JS/TS 2021-08-12 08:47:22 +02:00
antonk52
55e36f4011 place template string after braces 2021-07-07 00:15:21 +02:00
Samyak S Sarnayak
9799a80c55 fix(ecma): add indents to switch and cases
fixes nvim-treesitter#1384
2021-07-06 09:39:56 +02:00
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
Steven Sojka
eb6fdb5085 chore(injections): remove duplicated regex injection for js 2021-06-11 16:15:14 +02:00
antonk52
68bf36c917 highlights(ecma): use KeywordFunction as a highlight group for function 2021-05-17 19:22:00 +02:00
Santos Gallegos
67f0857015 Revert "Comment: use @combined to create just one tree per buffer (#1252)"
This reverts commit 4a7a713c52.
2021-05-07 16:51:57 +02:00