clangd / clangd

clangd language server
https://clangd.llvm.org
Apache License 2.0
1.58k stars 64 forks source link

clangd poped construction method of std::map when writting a comment #2162

Open YangZ2020 opened 2 months ago

YangZ2020 commented 2 months ago

As shown in figure below, clangd poped construction method of std::map when I write a comment. image

Here are three minimum code to replay the problem.

#include <string>
int main() {
    std::string c({{}});
    // cursor here:
}
#include <string>
int main() {
    std::string c{{{}}};
    // cursor here:
}
 #include <string>
int main() {
    std::string c{{(0)}};
    // cursor here:
}

System information

clangd --version: Apple clangd version 16.0.0 (clang-1600.0.26.3)

Editor/LSP plugin: Nvim lsp plugin

Operating system: Macbook M1 pro, macOS 15.0 (24A335), NVim 0.10.0

HighCommander4 commented 2 months ago

Could you try with the latest version from https://github.com/clangd/clangd/releases/tag/19.1.0 please?

If the bug still occurs in the latest version, please share clangd logs.

YangZ2020 commented 2 months ago

I have updated latest clang but the bug still exists. And I heard that the bug can be replayed on archlinux. Sorry that I do not know how to find clangd logs.

image

image

HighCommander4 commented 2 months ago

Sorry that I do not know how to find clangd logs.

Please see this section of the website about how to enable verbose logging, and this comment about how to access the logs.

HighCommander4 commented 2 months ago

Please see this section of the website about how to enable verbose logging

It looks like that anchor link does not work... I mean the section titled "Neovim built-in LSP client" (expand "Vim/Neovim" under Editor plugins.)

image