prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.13k stars 305 forks source link

Broken error-highlighting and missing diagnostic error (clangd, cxx) #1496

Open dusk-comes opened 1 year ago

dusk-comes commented 1 year ago

I faced an obscure error relating to a directory where an file is opened. Bellow attaching an screenshot of two opened files. One is placed in /tmp directory, another somewhere in my home directory. In the first case everything works as expected, while in the second case there are not any notices pointing to an syntax-error. Looking through vim-lsp.log file showed that clangd is replying by a correct message:

["<---",1,"clangd",{"response":{"method":"textDocument/publishDiagnostics","jsonrpc":"2.0","params":{"diagnostics":[{"source":"clang","relatedInformation":[],"range":{"end":{"character":12,"line":2},"start":{"character":4,"line":2}},"code":"undeclared_var_use","message":"Use of undeclared identifier 'errorcpp'","severity":1}],"uri":"file:///home/my_username/src/error.cpp","version":1}}}]

I tried to solve without success the problem by setting the file permissions for the directory as /tmp has.

Environments: _1. VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 18 2023 04:12:26) Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213

  1. Ubuntu 22.04.3 LTS
  2. vim-lsp: 7dd6b72d0c3ecbee08cdcee7e42d520f52c96208 refs/heads/master
  3. clangd: 13.0.0 (https://github.com/llvm/llvm-project/ 24c8eaec9467b2aaf70b0db33a4e4dd415139a50)_

photo_2023-09-15_14-14-00