doums / darcula

A Vim color scheme reproduction of the official JetBrains IDE Darcula theme
368 stars 59 forks source link

treesitter support #17

Closed tormodatt closed 3 years ago

tormodatt commented 3 years ago

just added kotlin-support for nvim-treesitter(https://github.com/nvim-treesitter/nvim-treesitter/pull/729), and I used this fork of this repo to test it. The goal was to make it quite close to the highlighting in intellj.

Skjermbilde 2020-12-06 kl  01 17 27 Skjermbilde 2020-12-06 kl  01 17 38

Other might appreciate this beeing merged upstream.

r-glebov commented 3 years ago

Nice, but how about other languages, like JS, Ruby, PHP etc? Should there something to be customized for Treesitter support for this theme?

tormodatt commented 3 years ago

all languages use the same treesitter keys. eg. TSFunction in highlight! link TSFunction Yellow. so with that set, all languages that are supported by treesitter should be highlighted as the Yellow color (as long as the language parser identifies the function correctly, and the mapping is set correctly in treesitter for that language). I can post how this config looks for some other languages here if you want.

I like this approach as the language logic is moved out from the theme. treesitter has also support for some more advanced features like highlight embedded (other) language etc.

r-glebov commented 3 years ago

I can post how this config looks for some other languages here if you want

That would be useful, especially for JS and Ruby, just to get more understanding on topic. Maybe I could help somehow to make this theme better. Thanks!

doums commented 3 years ago

Hi,

Treesitter support is planed. But it will not be added before neovim officially release a stable version including it. And I will associate darcula colors to Treesitter's highlight groups myself. Thank you anyway.

tormodatt commented 3 years ago

ok.

for those who find this PR and use treesitter already, my fork of this theme with treesitter support is located here: https://github.com/tormodatt/darcula.

doums commented 3 years ago

Hi @tormodatt, @r-glebov, just to let you know that I just added tree-sitter support.

https://github.com/doums/darcula/commit/c8bb18ff49cee4444718bc9dbbf63e7865c96fb2

tormodatt commented 3 years ago

great, thanks! would you consider adding support for nvim-lsp (which is also included in neovim 0.5) as well?

https://neovim.io/doc/user/lsp.html -> *lsp-highlight*

doums commented 3 years ago

Hi, cool I will add it too.

Warning, there seems to be a bug on the cursor line concerning treesitter, see https://github.com/doums/darcula/issues/20

EDIT: I juste added builtin LSP support https://github.com/doums/darcula/commit/8fb87b9e1461397c31d01b7ae77da578a0771400