sainnhe / edge

Clean & Elegant Color Scheme inspired by Atom One and Material
MIT License
860 stars 56 forks source link

when LSP loaded, highlight become weird since neovim0.9 #72

Closed MrZLeo closed 1 year ago

MrZLeo commented 1 year ago

I have done the following steps before reporting this issue:

Operating system/version

macOS Ventura Version 13.3

Terminal emulator/version

iTerm2 3.4.19

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix


==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

==============================================================================
man: require("man.health").check()

- OK plugin/man.vim not in $VIMRUNTIME
- OK autoload/man.vim not in $VIMRUNTIME

==============================================================================
mason: require("mason.health").check()

mason.nvim report ~
- OK neovim version >= 0.7.0
- OK Registry `require("mason-registry.index")` is installed.
- OK Registry `github.com/mason-org/mason-registry version: 2023-04-09-woeful-court` is installed.
- OK **unzip**: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- OK **Go**: `go version go1.20.3 darwin/arm64`
- OK **cargo**: `cargo 1.70.0-nightly (145219a9f 2023-03-27)`
- WARNING **luarocks**: not available
- OK **Ruby**: `ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]`
- OK **RubyGem**: `3.4.9`
- WARNING **Composer**: not available
- WARNING **PHP**: not available
- OK **npm**: `9.5.1`
- OK **node**: `v19.8.1`
- OK **python3**: `Python 3.11.2`
- OK **pip3**: `pip 23.0.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)`
- OK **javac**: `javac 18.0.2.1`
- OK **java**: `openjdk version "18.0.2.1" 2022-08-18`
- WARNING **julia**: not available
- OK **wget**: `GNU Wget 1.21.3 built on darwin22.1.0.`
- OK **curl**: `curl 7.87.0 (x86_64-apple-darwin22.0) libcurl/7.87.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0`
- OK **gzip**: `Apple gzip 403.100.6`
- OK **tar**: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
- WARNING **pwsh**: not available
- OK **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)`
- OK **sh**: `Ok`
- OK GitHub API rate limit. Used: 1. Remaining: 4999. Limit: 5000. Reset: Mon Apr 10 10:19:10 2023.

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /usr/local/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=^H`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="iTerm.app"
- $COLORTERM="truecolor"

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v19.8.1 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "arm64",
  release = "22.4.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - bibtex              ✓ . ✓ ✓ .
  - c                   ✓ ✓ ✓ ✓ ✓
  - cmake               ✓ . ✓ . .
  - comment             ✓ . . . .
  - cpp                 ✓ ✓ ✓ ✓ ✓
  - diff                ✓ . . . .
  - dockerfile          ✓ . . . ✓
  - fish                ✓ ✓ ✓ ✓ ✓
  - git_rebase          ✓ . . . ✓
  - gitattributes       ✓ . . . ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - gomod               ✓ . . . ✓
  - gowork              ✓ . . . ✓
  - haskell             ✓ . ✓ . ✓
  - json                ✓ ✓ ✓ ✓ .
  - json5               ✓ . . . ✓
  - latex               ✓ . ✓ . ✓
  - llvm                ✓ . . . .
  - lua                 ✓ ✓ ✓ ✓ ✓
  - make                ✓ . ✓ . ✓
  - markdown            ✓ . ✓ . ✓
  - markdown_inline     ✓ . . . ✓
  - ninja               ✓ . ✓ ✓ .
  - perl                ✓ . ✓ . ✓
  - proto               ✓ . ✓ . .
  - python              ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - rst                 ✓ ✓ . . ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - sql                 ✓ . . . ✓
  - toml                ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - yaml                ✓ ✓ ✓ ✓ ✓

  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: pbcopy

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

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
- 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.
    - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

Node.js provider (optional) ~
- Node.js: v19.8.1
- Nvim node.js host: /opt/homebrew/lib/node_modules/neovim/bin/cli.js
- OK Latest "neovim" npm/yarn/pnpm package is installed: 4.10.1

Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
  - ADVICE:
    - See :help |provider-perl| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

==============================================================================
telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.7.0

===== Installed extensions ===== ~

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /Users/mrzleo/.local/state/nvim/lsp.log
- Log size: 16275 KB

vim.lsp: Active Clients ~
- No active clients

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: bash       ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: bibtex     ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/bibtex.so
- OK Parser: c          ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/c.so
- OK Parser: cmake      ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/cmake.so
- OK Parser: comment    ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/comment.so
- OK Parser: cpp        ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/cpp.so
- OK Parser: diff       ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/diff.so
- OK Parser: dockerfile ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/dockerfile.so
- OK Parser: fish       ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/fish.so
- OK Parser: gitattributes ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/gitattributes.so
- OK Parser: git_rebase ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/git_rebase.so
- OK Parser: go         ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/go.so
- OK Parser: gomod      ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/gomod.so
- OK Parser: gowork     ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/gowork.so
- OK Parser: haskell    ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/haskell.so
- ERROR Parser "help" failed to load (path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/help.so): Failed to load parser: uv_dlsym: dlsym(0x9ae2b5e0, tree_sitter_help): symbol not found
- OK Parser: json       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/json.so
- OK Parser: json5      ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/json5.so
- OK Parser: latex      ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/latex.so
- OK Parser: llvm       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/llvm.so
- OK Parser: lua        ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so
- OK Parser: make       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/make.so
- OK Parser: markdown   ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: ninja      ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/ninja.so
- OK Parser: perl       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/perl.so
- OK Parser: proto      ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/proto.so
- OK Parser: python     ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
- OK Parser: rst        ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/rst.so
- OK Parser: rust       ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/rust.so
- OK Parser: sql        ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/sql.so
- OK Parser: toml       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/toml.so
- OK Parser: vim        ABI: 14, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: yaml       ABI: 13, path: /Users/mrzleo/.local/share/nvim/lazy/nvim-treesitter/parser/yaml.so
- OK Parser: c          ABI: 13, path: /usr/local/lib/nvim/parser/c.so
- ERROR Parser "help" failed to load (path: /usr/local/lib/nvim/parser/help.so): Failed to load parser: uv_dlsym: dlsym(0x9ae2b5e0, tree_sitter_help): symbol not found
- OK Parser: lua        ABI: 13, path: /usr/local/lib/nvim/parser/lua.so
- OK Parser: query      ABI: 14, path: /usr/local/lib/nvim/parser/query.so
- OK Parser: vim        ABI: 14, path: /usr/local/lib/nvim/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /usr/local/lib/nvim/parser/vimdoc.so

Minimal vimrc that can reproduce this bug.

local colorscheme = "edge"

local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then
    vim.notify("colorscheme " .. colorscheme .. " not found!")
    return
end

Steps to reproduce this bug using minimal vimrc

  1. open a rust file
  2. load rust-analyzer

Expected behavior

Before rust-analyzer finish loading:

image

Actual behavior

After:

image
leonardmorgan commented 1 year ago

I'm pretty sure it's the new LSP Semantic Highlighting. Edge uses only treesitter for highlighting. To disable LSP Semantic Highlighting you need to put "client.server_capabilities.semanticTokensProvider = nil" inside your lsp configuration.

MrZLeo commented 1 year ago

Understand. It works. Thanks! : )

antoineco commented 1 year ago

We need to fix this. See https://github.com/sainnhe/sonokai/issues/85