Comments (6)
Can you please provide an example project you are getting this error in
from astronvim.
- https://github.com/fish-shell/fish-shell/ fish-shell/src/fish_test_helper.cpp
- https://github.com/aristocratos/btop btop/src/btop.cpp
- or simple empty /tmp/test.cpp
BTW:
{
"notjedi/nvim-rooter.lua",
config = function() require("nvim-rooter").setup() end,
},
Works without issue.
from astronvim.
Can you also please provide your configuration or at the very least the language servers that attach when opening a C++ file
from astronvim.
config for cpp is the following line in ~/.config/nvim/lua/community.lua
:
{ import = "astrocommunity.pack.cpp" },
lsp info:
Language client log: /home/chz/.local/state/nvim/lsp.log
Detected filetype: cpp
1 client(s) attached to this buffer:
Client: clangd (id: 1, bufnr: [1])
filetypes: c, cpp, objc, objcpp, cuda, proto
autostart: true
root directory: /
cmd: /home/chz/.local/share/nvim/mason/bin/clangd
Configured servers list: lua_ls, pyright, clangd, taplo
lsp.log:
[START][2024-04-29 18:52:53] LSP logging initiated
[ERROR][2024-04-29 18:52:53] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:53.083] clangd version 18.1.3 (https://github.com/llvm/llvm-project c13b7485b87909fcf739f62cfa382b55407433c0)\nI[18:52:53.083] Features: linux+grpc\nI[18:52:53.083] PID: 4125370\nI[18:52:53.083] Working directory: /\nI[18:52:53.083] argv[0]: /home/chz/.local/share/nvim/mason/bin/clangd\nI[18:52:53.083] Starting LSP over stdin/stdout\nI[18:52:53.083] <-- initialize(1)\nI[18:52:53.083] --> reply:initialize(1) 0 ms\n"
[ERROR][2024-04-29 18:52:53] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:53.293] <-- initialized\nI[18:52:53.293] <-- textDocument/didOpen\nI[18:52:53.294] Loaded compilation database from /home/chz/Public/CodeRepo/btop/compile_commands.json\n"
[ERROR][2024-04-29 18:52:53] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:53.294] ASTWorker building file /home/chz/Public/CodeRepo/btop/src/btop.cpp version 0 with command \n[/home/chz/Public/CodeRepo/btop]\n/usr/bin/c++ --driver-mode=g++ -c -std=c++20 -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fexceptions -fstack-clash-protection -fcf-protection -fstack-protector -O2 -ftree-loop-vectorize -flto=16 -Wall -Wextra -pedantic -Iinclude -Isrc -o obj/btop.o -resource-dir=/home/chz/.local/share/nvim/mason/packages/clangd/clangd_18.1.3/lib/clang/18 -- /home/chz/Public/CodeRepo/btop/src/btop.cpp\n"
[ERROR][2024-04-29 18:52:53] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:53.294] --> window/workDoneProgress/create(0)\n"
[ERROR][2024-04-29 18:52:53] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:53.294] Enqueueing 8 commands for indexing\n"
[ERROR][2024-04-29 18:52:54] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:54.557] Built preamble of size 16817440 for file /home/chz/Public/CodeRepo/btop/src/btop.cpp version 0 in 1.26 seconds\n"
[ERROR][2024-04-29 18:52:54] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:54.557] --> workspace/semanticTokens/refresh(1)\n"
[ERROR][2024-04-29 18:52:54] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:54.557] Indexing c++20 standard library in the context of /home/chz/Public/CodeRepo/btop/src/btop.cpp\n"
[ERROR][2024-04-29 18:52:54] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "E[18:52:54.784] IncludeCleaner: Failed to get an entry for resolved path : No such file or directory\n"
[ERROR][2024-04-29 18:52:54] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:54.790] --> textDocument/publishDiagnostics\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.186] <-- reply(0)\nI[18:52:56.186] --> $/progress\nI[18:52:56.186] --> $/progress\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.191] <-- reply(1)\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.195] <-- textDocument/documentSymbol(2)\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.195] <-- textDocument/semanticTokens/full(3)\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.198] --> reply:textDocument/documentSymbol(2) 3 ms\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.200] <-- textDocument/documentHighlight(4)\nI[18:52:56.202] --> reply:textDocument/semanticTokens/full(3) 7 ms\nI[18:52:56.203] --> reply:textDocument/documentHighlight(4) 2 ms\n"
[ERROR][2024-04-29 18:52:56] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:56.512] Indexed c++20 standard library (incomplete due to errors): 15837 symbols, 10765 filtered\n"
[ERROR][2024-04-29 18:52:58] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:58.176] <-- textDocument/documentHighlight(5)\nI[18:52:58.176] --> reply:textDocument/documentHighlight(5) 0 ms\n"
[ERROR][2024-04-29 18:52:58] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:58.208] <-- $/cancelRequest\nI[18:52:58.208] <-- textDocument/documentHighlight(6)\nI[18:52:58.208] --> reply:textDocument/documentHighlight(6) 0 ms\n"
[ERROR][2024-04-29 18:52:58] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:58.272] <-- textDocument/foldingRange(7)\n"
[ERROR][2024-04-29 18:52:58] .../vim/lsp/rpc.lua:734 "rpc" "/home/chz/.local/share/nvim/mason/bin/clangd" "stderr" "I[18:52:58.282] --> reply:textDocument/foldingRange(7) 10 ms\n"
from astronvim.
@c02y it looks like something wrong may be happening with your setup. The clangd
root that is getting detected is /
from the language server. This seems like it is probably a problem.
On the other hand, this does identify an issue where the normalization of the path "/"
resulted in ""
which is incorrect. I have resolved this in AstroCore and the release will post soon! Thanks for reporting!
from astronvim.
I got /.clang-format
file which is supposed to be used by clangd to format the cpp files, I use this in Lunarnvim, but I haven't found a way to let AstroNvim use this file.
Not sure if this file is the root cause.
=========================
UPDATE:
/.clang-format
is the root cause, I tried to delete the file, it works fine.
I updated AstroNvim to v4.4.0, there would be two notifications about the Root changes, one was CWD is changed to the project directory, one was CWD is changed to /
, and there was an error message. After I removed /.clang-format
, the /
notification is gone and no error.
from astronvim.
Related Issues (20)
- AstroNvim 4.0 version, shellcheck not displayed and not working HOT 3
- Disable breadcrumbs? HOT 1
- Can't get <C-s> mapping to work in insert mode HOT 3
- Multiple model bindings HOT 1
- Bug when closing the toggleterm terminal HOT 3
- `<Leader>gg` and `<Leader>tl` always map to the same command HOT 2
- plugin `nvim-metals` doesn't work in Astronvim HOT 4
- Can't use astrotheme if nvim starts with a different theme HOT 5
- gdu not detected for windows/powershell HOT 7
- Don't load DAP when it's not needed HOT 7
- Failed to run `init` for **nvim-treesitter** HOT 1
- vue file save HOT 1
- Replace `nvim-colorizer` with `nvim-highlight-colors` HOT 5
- Empty lines trigger popup with logs HOT 3
- Vacation Notice 🌞 (until May 21, 2024) HOT 1
- Bug: The nerd Icon became `E` after the cmd was canceled. HOT 2
- Feature: add feature auto close inlayhints in insert mode. HOT 2
- large file makes it unusable HOT 1
- Replace `neodev.nvim` with `lazydev.nvim` HOT 2
- Astronvim encountered an error after update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astronvim.