Git Product home page Git Product logo

Comments (6)

jrwrigh avatar jrwrigh commented on June 11, 2024 1

Not a specific issue, but a lot of issues.

This is running nvim 8.3.0:
image

This is running nvim 0.9.0:
image

As far as I can tell, the treesitter parsing is identical, but the highlighting is completely different/wrong.

from sonokai.

antoineco avatar antoineco commented on June 11, 2024

@ highlight groups do break Vim as well as Neovim versions lower than 0.8.0. They need to be added behind this conditional:

if has('nvim-0.8.0')

I'm also using Neovim 0.9.0 and LSP highlights seem to be working without further changes. Are you having any specific issue?

from sonokai.

antoineco avatar antoineco commented on June 11, 2024

Good point, it seems like Neovim 0.9.0 links LSP highlight groups to Vim's default groups, whereas this colorscheme uses different highlighting paradigms whether the code is highlighted using classic Vim syntax or Treesitter. We should re-link those to Treesitter highlights.

from sonokai.

jrwrigh avatar jrwrigh commented on June 11, 2024

Ok, linking the lsp variables I was able to get this:
image

with this diff:

diff --git i/colors/sonokai.vim w/colors/sonokai.vim
index a85a823..974e605 100644
--- i/colors/sonokai.vim
+++ w/colors/sonokai.vim
@@ -579,6 +579,28 @@ if has('nvim-0.8.0')
   highlight! link @variable TSVariable
   highlight! link @variable.builtin TSVariableBuiltin
 endif
+if has('nvim-0.9.0')
+  highlight! link @lsp.type.type TSType
+  highlight! link @lsp.type.class TSType
+  highlight! link @lsp.type.enum TSType
+  highlight! link @lsp.type.interface TSType
+  highlight! link @lsp.type.struct TSType
+  highlight! link @lsp.type.typeParameter TSType
+  highlight! link @lsp.type.parameter TSParameter
+  highlight! link @lsp.type.variable TSVariable
+  highlight! link @lsp.type.property TSProperty
+  highlight! link @lsp.type.enumMember TSProperty
+  highlight! link @lsp.type.events TSLabel
+  highlight! link @lsp.type.function TSFunction
+  highlight! link @lsp.type.method TSMethod
+  highlight! link @lsp.type.keyword TSKeyword
+  highlight! link @lsp.type.modifier TSOperator
+  highlight! link @lsp.type.comment TSComment
+  highlight! link @lsp.type.string TSString
+  highlight! link @lsp.type.number TSNumber
+  highlight! link @lsp.type.regexp TSStringRegex
+  highlight! link @lsp.type.operator TSOperator
+endif
 " }}}
 " github/copilot.vim {{{
 highlight! link CopilotSuggestion Grey

which is more-or-less a copy paste of the LspSemantic* tokens, but replacing them with the @lsp.type.* ones. So much improved, but the diagnostic (highlighting at the very top) is still wrong (greyed out, should at least be underlined).

from sonokai.

antoineco avatar antoineco commented on June 11, 2024

Thanks a lot for the initial investigation!

About the diagnostic message, is the example with or without g:sonokai_diagnostic_text_highlight = 1?

from sonokai.

jrwrigh avatar jrwrigh commented on June 11, 2024

About the diagnostic message, is the example with or without g:sonokai_diagnostic_text_highlight = 1?

That's without that setting. I discovered through :Inspect (new 0.9.0 command, very nice, much like) that the highlight group for it was DiagnosticUnnecessary, which wasn't handled by the sonokai color scheme. Adding:

  highlight! link DiagnosticUnnecessary WarningText

to the same if statement block above gets that back to normal. I just chose WarningText as it's what is used for DiagnosticUnderlineWarn.

Now I get this:
image
which I think is correct. lsp is now correctly overriding TS to see it as a function declaration rather than a variable to the function CEED_QFUNCTION (which is just a macro).

from sonokai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.