Commit graph

917 commits

Author SHA1 Message Date
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
Jirgn
979c32493d feat: add fusion grammar and highlights 2021-11-26 22:04:59 +01:00
Sergio Alejandro Vargas
fbbcfa7b6c highlights(rust): organize keywords and literals
- sort keywords
- highlight super as a namespace (same as crate)
- highlight `break` and `continue` as `repeat` keywords
- don't highlight `macro_rules!` as a keyword
- place all literal queries together
- place function definition queries alongside function call queries
2021-11-25 23:53:41 +01:00
Sergio Alejandro Vargas
81f75a54ff highlights(rust): update operators
- sort operators
- remove duplicated `*`
- add missing `<<=`

- highlight `as` correctly in path aliasing
- highlight leading quote `'` as part of a label (not an operator)
- highlight never type `!` as a type

- sort and format punctuation
2021-11-25 23:53:41 +01:00
Stephan Seitz
08243017f2 Rename queries: godotResource -> godot_resource 2021-11-25 23:02:57 +01:00
numToStr
801c7f0b48 ecma: highlight private properties and methods 2021-11-25 15:42:24 +01:00
maxxnino
ff2897e5b7 zig: highlight zig format, type and function 2021-11-23 16:46:27 +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
aspeddro
190bcc8d56 r add new highlights 2021-11-18 14:16:09 +01:00
vhyrro
d78fb79ed6
Add basic vimscript injection in vim.cmd/nvim_command/nvim_exec (#1922) 2021-11-16 21:14:22 -05:00
Santos Gallegos
b972f1d985 C: fix preproc parameters
This was capturing too much,
we only want to highlight the identifier.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1999
2021-11-14 11:02:57 +01:00
aspeddro
741812af8f r add new highlights 2021-11-12 22:02:52 +01:00
Stephan Seitz
8fe8415ae8 injections(http): add comment injection 2021-11-12 21:52:50 +01:00
gegoune
bb0ef18488 refactor: inherit json 2021-11-12 21:52:50 +01:00
gegoune
599bdaf2f0 fix: address change requests 2021-11-12 21:52:50 +01:00
gegoune
a93c5b80d7 feat: add http parser
All credit goes to @NTBBloodbath.

See: https://github.com/NTBBloodbath/rest.nvim/issues/75#issuecomment-960447966

Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
2021-11-12 21:52:50 +01:00
Santos Gallegos
6888242b98 Python: highlight semicolon 2021-11-12 19:51:04 +01:00
Łukasz Niemier
6372b689eb fix: use more specific identifier check 2021-11-12 13:42:36 -05:00
Łukasz Niemier
fdcd0edf24 fix: make comment doc highlighting work for any doc tag 2021-11-12 13:42:36 -05:00
Łukasz Niemier
2c2d4d89fd fix: Elixir non-doc sigils will no longer be flickering
It also adds support for colouring documentation metadata attributes
(ex. `@doc foo: :bar`).
2021-11-12 13:42:36 -05:00
aspeddro
5706b1346b r: add new operator 2021-11-12 12:48:26 -05:00
Cameron
e28b65bb52 Add Operators for Ruby
Many operators were missing from ruby, so, I added them.

Additionally, with string interpolation (`"#{xxx}"`), the closing `}` was being matched to `punctuation.bracket` instead of `punctuation.special`, so I fixed that too.

I didn't see any further details about how to contribute, so if I've overlooked anything, I'll be happy to add it.
2021-11-11 21:04:42 -05:00
Cyril Mizzi
94fa0d3189 fix(vue.indents): add support for template_element 2021-11-11 21:00:33 -05:00
Cyril Mizzi
8d6c2b0044 fix: define indents.scm for html_tags and inherits html and vue from this file 2021-11-11 21:00:33 -05:00
Cyril Mizzi
ce866ecc2f feat(vue): add indents.scm file
There's no indentation file for Vue. This implementation is based on the HTML indentation file with a minor support for the `template_element` tag. As JS is bind with the JS Tree-sitter, the indentation is already fine.
2021-11-11 21:00:33 -05:00
Lewis Russell
ece0f70139 fix(teal): highlighting for types 2021-11-04 20:42:36 +01:00
Dundar Göc
6a4fdb317d chore: fix typos 2021-11-02 23:47:48 +01:00
elianiva
0916cceab2
feat(svelte): inject JS on each expression (#1969) 2021-11-02 10:59:23 -05:00
Santos Gallegos
6d08b25f0e Update queries/python/highlights.scm 2021-11-01 16:54:46 +01:00
Santos Gallegos
df06643aa1 Revert "feat: add del keyword for highlights"
This reverts commit 385193d41f.
2021-11-01 16:54:46 +01:00
Ashish Panigrahi
385193d41f feat: add del keyword for highlights 2021-11-01 13:19:27 +01:00
Santos Gallegos
0dd147e6b7 D: fix duplicate @namespace capture
The previous query was highlighting everything inside that node,
but we only want to highlight the identifiers.

Ref https://github.com/nvim-treesitter/nvim-treesitter/pull/1930/files#r735105675
2021-10-31 10:22:43 +01:00
Santos Gallegos
bd13991050
Rust: highlight uppercase identifiers in match arms as constant (#1940)
* Rust: highlight uppercase identifiers in match arms as constant

Closes https://github.com/nvim-treesitter/nvim-treesitter/issues/1928

* Highlight builtins
2021-10-30 12:09:54 -05:00
Santos Gallegos
fe4e4aa286
yaml: improve highlights and locals (#946)
- More scopes
- Highlight strings as strings
- Recognize more keys/fields

Improvements can be seen with this weird yaml:

```yaml
{ foo: bar }
---
{a: [b, c], [d, e]: f}

---
- { single line, a: b}
- { multi
  line, a: b}
---

"fooo": bar
'foo': bar
one: two
```
2021-10-26 22:47:59 -05:00