Commit graph

70 commits

Author SHA1 Message Date
Amaan Qureshi
853b1ab39a style: fill in missing code docs wherever applicable 2023-02-24 01:08:23 -08:00
Lewis Russell
27d8fdc6a6 fix: do not force syntax=ON on detach
syntax is now restored in vim.treesitter.stop() so we don't need to
force it on here.
2023-01-04 14:08:28 +00:00
Stephan Seitz
cf60564891 fix: do vim.treesitter.start() on highlight module attach
Fixes #4026
2022-12-26 13:42:11 +01:00
Lewis Russell
0948bf2274 feat(emmy): add emmylua annotations 2022-10-31 12:00:45 +01:00
Christian Clason
42ab95d5e1 feat!: remove obsolete TS* highlight groups 2022-10-16 15:50:55 +02:00
Thomas Vigouroux
b273a06728 fix: don't overwrite highlights when defining 2022-10-08 11:28:04 +02:00
Christian Clason
8e763332b7 fix(test): update tests to Nvim 0.8 2022-10-02 09:29:34 -04:00
Null Chilly
1a85a335c2 fix(highlight): respect g:skip_ts_default_groups on ColorScheme autocmd 2022-09-19 17:12:40 +02:00
Akin Sowemimo
557123a616 fix(highlight): ensure link captures function exists
before attempting to call it
fixes #3465
2022-09-09 16:29:14 +02:00
Akin Sowemimo
a601a12bae chore(highlight): re-add earlier call 2022-08-31 12:03:08 -07:00
Akin Sowemimo
65d0818fed fix(highlight): ensure links are rebuilt on colorscheme change 2022-08-31 12:03:08 -07:00
Christian Clason
7bd8b87df1 fixup: facepalm 2022-08-26 16:01:09 +02:00
Christian Clason
1baf751fb0 fix(hl_map): adapt to upstream changes on master
https://github.com/neovim/neovim/pull/19931 adds direct support for
highlighting capture groups (with fallback), obviating the need for
`vim.treesitter.highlighter.hl_map`. Instead of

`hl_map["@keyword"] = "TSKeyword"`

users can simply

`hi link TSKeyword @keyword`

Check for the existence of `hl_map` and either use the former or the
latter.
2022-08-26 06:04:07 -07:00
lfenzo
a51ef77674 Added function/method call highlight groups 2022-08-03 12:05:30 -07:00
John Drouhard
635c450939 feat(highlight): re-apply default highlights on colorscheme changes
If the plugin is loaded after a colorscheme is set that defines any of
these highlight groups, the default won't be applied. Subsequent
"highlight clear" commands (common when switching colorschemes) will
then clear any of those highlights, but these defaults never have
another opportunity to be initialized.

Effectively, if you load neovim with a colorscheme that has definitions
for some of these highlight groups, then load treesitter, then switch
colorschemes, many of these default links will be absent resulting in
colors that do not appear the same as if that colorscheme had been
used at startup.

Hooking the ColorScheme event with an autocmd that just reapplies these
defaults gives every colorscheme switch the opportunity to get the
defaults for non-explicitly-defined groups.
2022-07-30 20:13:24 +02:00
Gregory Anders
e2b2d2357b Add capture groups for remaining builtin highlight groups
Some builtin highlight groups (see `:h group-name`) do not yet have
associated capture groups, so add them.
2022-03-30 22:14:23 +02:00
kiyan
560e8fb450 refacto: expose a function to set custom capture for the higlighter
BREAKING: deprecate custom_captures from highlight config.
This allows plugin authors to extend the map. It also avoids settings
user configuration specific values during the highlighter
initialization (SOC).
Not sure how much value this brings, and might potentially break a lot
of people configurations. This is questionable.
2022-02-19 18:26:51 +01:00
kiyan
a0b7cece2c chore: expose start and stop highlighter
Decompose highlighter module in small functions to allow exporting a
start and stop functions without the syntax change.
Also fix linter issues in configs.lua
2022-02-06 15:12:34 +01:00
Simon Hauser
e473630fe0 fix: make additional_vim_regex_highlighting actually accept a list 2021-07-20 09:36:22 +02:00
lmlorca
fb5d6e04a8 add @tag.attribute for html like attributes 2021-07-14 10:13:13 +02:00
Santos Gallegos
647268183f
Highlights: define string.special (#1551)
* Highlights: define string.special

This was in our CONTRIBUTING.md file,
but wasn't defined.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1405

* Use string.escape
2021-07-11 15:59:53 -05:00
Santos Gallegos
be8f656087
Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00: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
kmarius
8adb2e0352 fix typo: Enviroment -> Environment 2021-06-22 07:27:00 +02:00
Munif Tanjim
1cc06ac8ba highlight: add 'comment' to hlmap 2021-04-24 16:52:37 +02:00
Stephan Seitz
712cc78a1e Add text.reference and text.environment 2021-03-30 19:26:37 +02:00
Stephan Seitz
0556edf5f3 latex: add TSMath that behaves like vimtex math highlighting 2021-03-30 19:26:37 +02:00
Stephan Seitz
7dacd66aec feat: Allow tables for additional_vim_regex_highlighting 2021-03-18 12:03:37 +01:00
Stephan Seitz
ff9bf6dc2b feat: Allow to configure to use syntax and tree-sitter together 2021-03-18 12:03:37 +01:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Dennis B
aca33c0aca [highlights] Add TSSymbol highlight group
Addresses issue #892

Ruby and Dart literal symbols will now be highlighted by the new
TSSymbol highlight group, which itself will, by default, link to the Vim
Identifier highlight group. Vim theme authors can then set their
TSSymbol colors.

Symbol highlighting can apply to a number of languages as noted in the
following Wikipedia page: https://en.wikipedia.org/wiki/Symbol_(programming)

Not just for Ruby and Dart.
2021-03-04 06:19:40 +01:00
Santos Gallegos
b86555d9c3 HTML: improve highlights & injections 2021-02-11 07:42:19 +01:00
Thomas Vigouroux
7edf1d1c2b fix(highlight): fix detach function
Fixes #798
2021-01-14 12:11:32 +01:00
Thomas Vigouroux
a48c440f2b fix(highlight): remove unneeded query management 2021-01-14 12:11:32 +01:00
delphinus
b938e4f0fe Remove deprecated highlights 2020-12-21 22:32:17 +01:00
rockerBOO
d8d90909a9 typo 2020-12-07 21:50:47 +01:00
rockerBOO
3a337e0b3c cleanup: Add additional context 2020-12-07 21:50:47 +01:00
rockerBOO
07e86b1553 docs: Update docs for missing groups, re-order alphabetically 2020-12-07 21:50:47 +01:00
Thomas Vigouroux
808765a6c8
fix: update interface following languagetree merge (#687) 2020-11-23 12:46:27 -06:00
Thomas Vigouroux
f7d92f663c feat(languagetree): implement language tree
Allow the LanguageTree to be used as an option for highlighting.

Co-authored-by: Santos Gallegos <stsewd@protonmail.com>
Co-authored-by: Yazdani Kiyan <yazdani.kiyan@protonmail.com>
2020-10-19 18:28:45 +02:00
Thomas Vigouroux
06452845d6 fix(highlights): use new highlighter interface 2020-10-13 09:25:09 +02:00
Thomas Vigouroux
2c8d401bb8 highlight: use new highlighter interface 2020-10-12 20:04:31 +02:00
Stephan Seitz
45397ebbd9 fix(highlights): Add TSNamespace highlight
Start adding highlights for
     - C++
     - Rust (including other scoped_identifier/scoped_type_identifier fixes)
     - JS (only namespace_import)

Addresses #516
2020-10-10 15:31:51 +02:00
Stephan Seitz
7e3c4f8089 Add @keyword.operator for operators that are English words and add @exception for Java/JS 2020-09-19 07:30:49 +02:00
Akin Sowemimo
3652bed53e Re-add attribute highlight 2020-09-18 21:30:13 +02:00
TravonteD
c366a041c8 Add TSTag and TSTagDelimiter groups
These groups will be added for use with xml-like tags such as html and
jsx.
2020-09-18 17:09:43 +02:00
kiyan42
71ba2afc70 add TSNone 2020-09-15 00:19:04 +02:00
Steven Sojka
3fe8bbcf9c fix(modules): do not reattach if already attached 2020-08-22 06:07:21 -05:00
Steven Sojka
579c9936d6 feat(highlights): add is predicate 2020-08-16 09:04:07 -05:00