bluz71 / vim-moonfly-colors

A dark charcoal theme for modern Neovim & classic Vim
MIT License
866 stars 65 forks source link

Question: Better highlighter command support for Dockerfile with treesitter, LSP Dockerls #43

Closed huyhoang8398 closed 1 year ago

huyhoang8398 commented 1 year ago

image Is this possible to highlight these cmd for Dockerfile? Im using treesitter, lsp dockerls I think LSP semantic highlighting conflict with treesitter,

Bellow is an example with another colorscheme

image

bluz71 commented 1 year ago

It should be somewhat better now.

However, I could not replicate the other colorscheme granularity where chmod is colored green and the parameters such as +x /usr/local/bin/p4 are colored white (in your second screenshot).

From what I can tell the whole statement chmod +x /usr/local/bin/p4 is captured by @lsp.type.parameter.dockerfile highlight group. Maybe that other colorscheme has custom captures?

Which colorscheme is it? It looks like a Gruvbox style, which one exactly?

P.S. To be honest, I think the Tree-sitter highlights look better than the LSP semantic highlights for Dockerfile; if it were me I would disable LSP semantic highlights for the Docker Language Server.

huyhoang8398 commented 1 year ago

Agreed. I will disable LSP semantic highlight for Dockerfile and use Tree-sitter image

treesitter is much better image

bluz71 commented 1 year ago

Agreed, the Dockerfile language server semantic highlights are kind-of awful.

huyhoang8398 commented 3 months ago

I re-open this not sure it due to Treesitter or the colorscheme, currently i have a sample dockerfile like this ( auto generate base on docker init ) image i guess due to the line appuser, the comment become arguments

huyhoang8398 commented 3 months ago

@bluz71 can we re-open this issue?

bluz71 commented 3 months ago

I re-open this not sure it due to Treesitter or the colorscheme

I can almost guarantee that is a Tree-sitter issue for Docker filetype. Colorschemes don't control where the styling goes, only what the colors will be. The two lower arrows indicate sections that should be highlighted as Comment.

Put your mouse on one of those two lines and run :lua vim.show_pos(), what does it say?

Also, what does the same Dockerfile look like when opened with a different colorscheme such as TokyoNight?

For the moment, I don't feel it is correct to re-open this if it is a Tree-sitter issue (which I believe it is).

huyhoang8398 commented 3 months ago

image

huyhoang8398 commented 3 months ago

yeah, it breaks also in other colorscheme, i will open issue in TS

huyhoang8398 commented 3 months ago

https://github.com/nvim-treesitter/nvim-treesitter/issues/6975

bluz71 commented 3 months ago

Yes, confirmed to be an upstream issue.

Best of luck.