Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition highlight not right on cpp. #5

Open
fgheng opened this issue Oct 28, 2020 · 1 comment
Open

Definition highlight not right on cpp. #5

fgheng opened this issue Oct 28, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@fgheng
Copy link

fgheng commented Oct 28, 2020

Describe the bug
Hello, look at this code, if cursor on ::reused, the global value reused should be highlight, but the local value reused highlight.

  #include <iostream>
  
  int reused = 42;
  
  int main(int argc, char *argv[]) {
    int unique = 0;
    std::cout << reused << " " << unique << std::endl;
    int reused = 0;
    std::cout << reused << " " << unique << std::endl;
    std::cout << ::reused << " " << unique << std::endl;
  
    return 0;
  }

image
image

Expected behavior
the global value reused should be highlight.

Output of :checkhealth nvim_treesitter

health#nvim_treesitter#check

Installation

  • OK: git executable found.
  • OK: cc executable found.

elm parser healthcheck

c parser healthcheck

teal parser healthcheck

java parser healthcheck

python parser healthcheck

dart parser healthcheck

lua parser healthcheck

  • OK: lua parser found.
  • OK: highlights.scm found.
  • OK: locals.scm found.
  • OK: folds.scm found.
  • OK: indents.scm found.

ocaml parser healthcheck

go parser healthcheck

nix parser healthcheck

yaml parser healthcheck

json parser healthcheck

jsdoc parser healthcheck

php parser healthcheck

julia parser healthcheck

html parser healthcheck

typescript parser healthcheck

fennel parser healthcheck

swift parser healthcheck

query parser healthcheck

cpp parser healthcheck

regex parser healthcheck

verilog parser healthcheck

ruby parser healthcheck

vue parser healthcheck

ocamllex parser healthcheck

scala parser healthcheck

ql parser healthcheck

rust parser healthcheck

toml parser healthcheck

bash parser healthcheck

rst parser healthcheck

css parser healthcheck

ocaml_interface parser healthcheck

javascript parser healthcheck

c_sharp parser healthcheck

haskell parser healthcheck

tsx parser healthcheck

Output of nvim --version

NVIM v0.5.0-781-ga22fe09b9
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-cf8f8ff3-8560-4d24-8cbb-fea1921bfd23

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

Additional context
Add any other context about the problem here.

@fgheng fgheng added the bug Something isn't working label Oct 28, 2020
@steelsojka
Copy link
Collaborator

Currently this is expected by the implementation. Scopes are defined by their parent nodes and don't take into account where they are defined amongst their siblings. This will take some rework to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants