sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

Non-used type is not dimmed (grayed out) #117

Closed FernandoBasso closed 2 years ago

FernandoBasso commented 2 years ago

Operating system/version

Arch Linux (rolling release)

Terminal emulator/version

Terminator 2.1.1 from the repositories

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix


coc: health#coc#check
========================================================================
  - OK: Environment check passed
  - OK: Javascript bundle build/index.js found
  - OK: Service started

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='6602'
  - INFO: $COLORTERM='truecolor'

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found  0.20.2 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.13.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 11.1.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - typescript     ✓ ✓ ✓ ✓ ✓ 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          python2 not found in search path or not executable.
          python2.7 not found in search path or not executable.
          python2.6 not found in search path or not executable.
          /usr/bin/python is Python 3.10 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.10.1
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v16.13.1
  - INFO: Nvim node.js host: /home/fernando/.nvm/versions/node/v16.13.1/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.1

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/fernando/.cache/nvim/lsp.log
  - INFO: Log size: 70 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for typescript: ABI version 13

Minimal vimrc that can reproduce this bug.

" UTF-8: 💩 λ ‽ ✔
set encoding=utf-8
set termguicolors

let data_dir = stdpath('data') . '/site'

if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin(data_dir . '/plugged')
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
Plug 'sainnhe/gruvbox-material'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()

filetype plugin indent on
syntax on
set nocompatible

let &t_Cs = "\e[4:3m"
let &t_Ce = "\e[4:0m"

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CoC — Conquer of Completion
" ---------------------------
"
"

let g:coc_global_extensions = [
      \ 'coc-tsserver',
      \ ]

" lua <<EOF
" require'nvim-treesitter.configs'.setup {
"   ensure_installed = { "typescript" },
"   sync_install = false,
"   ignore_install = { },
"   highlight = {
"     enable = true,
"     disable = { "c", "rust" },
"     additional_vim_regex_highlighting = false,
"   },
" }
" EOF

set background=dark
let g:gruvbox_material_palette = 'material'
let g:gruvbox_material_disable_italic_comment = 1
let g:gruvbox_material_diagnostic_text_highlight = 0
let g:gruvbox_material_diagnostic_line_highlight = 0
let g:gruvbox_material_diagnostic_virtual_text = 'colored'

colorscheme gruvbox-material

NOTE: I get the same result whether or not I uncomment the tree-sitter lua section.

Steps to reproduce this bug using minimal vimrc

Here's a screenshot in Vim, with original Gruvbox:

image

Note how TheType is dimmed/grayed out. And here's a screenshot with Neovim 6.1, with TreeSitter and gruvbox-material:

image

In both cases I'm using coc.vim with a TypeScript buffer.

I tried to look at the source code for gruvbox-material but couldn't find out if this feature is just not-implemented, or I am lacking some configuration. I see highlight! link CocFadeOut Grey in the gruvbox-material.vim file but not sure why it is not kicking in.

This is my current gruvbox-material configuration:

This might be relevant: https://github.com/neoclide/coc.nvim/issues/1046.

Expected behavior

The expected behavior is that the unused TheType is grayed out or dimmed out just as fnF or unusedParam.

image

Actual behavior

We don't get dimmed out/grayed out syntax for unused types (other stuff are dimmed or not dimmed correctly).

FernandoBasso commented 2 years ago

I think the problem is something else. It is working.

I open the typescript file, and TheType is not dimmed. If I run :edit or use then unuse the type, and it gets dimmed out.

PS: This is not a real problem for me, and it is not true that it doesn't dim unused types. I'm OK with closing this issue.

sainnhe commented 2 years ago

What a color scheme does is to define highlight groups, it doesn't actually highlight the text. Instead, it's done via highlight engines like built-in vim syntax engine and coc, they read the color code in predefined hi groups and highlight the text.

So if it sometimes dim, it means the highlight engine could those hi groups.

IMO this bug is caused by coc or coc-tsserver.