Nvim-lspconfig: `document_highlight` doesn't work?

Created on 9 Oct 2020  路  1Comment  路  Source: neovim/nvim-lspconfig

  • nvim --version: v0.5.0-743-gce5a260c9
  • nvim-lsp version(commit hash): 60133c47e0fd82556d7ca092546ebfa8d047466e
  • :checkhealth result:
  - INFO: gopls: configuration checked.
  - INFO: tsserver: configuration checked.

How to reproduce the problem from neovim startup

  1. Open a file of a supported type (.go/.ts in my case).
  2. Place cursor on a symbol.
  3. :lua vim.lsp.buf.document_highlight().

Actual behaviour

No symbols are highlighted.

Expected behaviour

The symbol under the cursor is highlighted, along with any other occurrence in the same buffer.

Inspecting the logs, both of the LSPs above are returning payloads with the correct range info. Other LSP functions seem to work as expected.

bug

Most helpful comment

This was just a highlighting issue :P I needed to define the corresponding syntax groups, e.g.:

hi LspReferenceText cterm=bold gui=bold
hi LspReferenceRead cterm=bold gui=bold
hi LspReferenceWrite cterm=bold gui=bold

>All comments

This was just a highlighting issue :P I needed to define the corresponding syntax groups, e.g.:

hi LspReferenceText cterm=bold gui=bold
hi LspReferenceRead cterm=bold gui=bold
hi LspReferenceWrite cterm=bold gui=bold
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChrisAmelia picture ChrisAmelia  路  3Comments

teto picture teto  路  10Comments

cideM picture cideM  路  6Comments

DarkDefender picture DarkDefender  路  3Comments

justinmk picture justinmk  路  8Comments