Comments (6)
Screen.Recording.2023-07-17.at.20.08.31.mov
Here is the video, you could see wget
is highlighted as green and then becoming white
from sonokai.
Oh, you have the LSP server for Dockerfile active apparently, and that LSP server has semantic tokens enabled. LSP semantic token are providing extra highlighting in addition to Tree-sitter.
Support for LSP semantic tokens was added in Sonokai in #86.
In sainnhe/everforest#119, I tried to determine whether we could customize those color schemes ever further to improve the experience with LSP semantic tokens, but my conclusion was that LSP semantic tokens highlights sometimes conflict with Tree-sitter pretty badly. From my experience, this feature degrades the highlights more than it improves them. For instance, I wasn't able to enhance highlights for the Go language due to the priority that the LSP semantic token highlights were given over Tree-sitter's.
Thanks a lot for the video 👍 I will check whether we can improve the Dockerfile file type specifically for LSP semantic tokens. In case that's not possible, it's probably best to disable that feature.
from sonokai.
I was able to disable this feature in dockerls with the following lspconfig:
After disable tthat feature, it's working well now, thanks
from sonokai.
Yes, you simply need to enable Tree-sitter for the "Dockerfile" filetype with :TSInstall dockerfile
.
Here is how it looks for me:
from sonokai.
from sonokai.
I just investigated the issue, and unfortunately LSP semantic highlights override Tree-sitter entirely in this case.
Tree-sitter has smart queries which allows detecting and highlighting sh
/bash
inside Dockerfiles. You can see it in the screenshot below as:
Treesitter
- @variable.bash links to @variable bash <!-- bash detected -->
- @constant.bash links to @constant bash
Unfortunately, as soon as LSP semantic tokens are enabled, everything becomes a "parameter" instead, and the embedded highlights are overridden:
Semantic Tokens
- @lsp.type.parameter.dockerfile links to @parameter priority: 125 <!-- higher priority than Tree-sitter -->
Screenshot:
That's why all the colors disappear in your video. I see the exact same behavior in my Neovim with the dockerls
LSP server enabled.
I was able to disable this feature in dockerls
with the following lspconfig:
local lspconfig = require "lspconfig"
lspconfig.dockerls.setup {
on_attach = function(client, bufnr)
client.server_capabilities.semanticTokensProvider = nil
end,
}
from sonokai.
Related Issues (20)
- Better ruby highlights HOT 4
- [Question] Does the colorscheme need to do something to support hrsh7th/cmp-nvim-lsp-signature-help HOT 1
- Add WinBar and WinBarNC HOT 8
- Error when define colorscheme sonokai HOT 2
- A lot of highlight warning. HOT 2
- How to change style to Andromeda in lua? HOT 2
- Emacs Port? HOT 4
- bufferline HOT 3
- Can't have transparent background Everywhere HOT 3
- How to set Espresso mode? HOT 2
- Nvim-navic has wrong background color in statusline from lualine HOT 5
- Interest in support nvim lsp semantic highlighting? HOT 6
- LSP saga floating window design HOT 9
- Support Neo-tree.nvim HOT 5
- help with folke/noice.nvim and mini view HOT 5
- Configuration for dim float window style HOT 2
- Questions: Better way to highlight variable with {} in shell script HOT 1
- Support vim HOT 3
- Variables starting with uppercase letter have different color HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonokai.