Giter VIP home page Giter VIP logo

Comments (6)

mehalter avatar mehalter commented on June 26, 2024

Can you please provide an example project you are getting this error in

from astronvim.

c02y avatar c02y commented on June 26, 2024

BTW:

{
    "notjedi/nvim-rooter.lua",
    config = function() require("nvim-rooter").setup() end,
  },

Works without issue.

from astronvim.

mehalter avatar mehalter commented on June 26, 2024

Can you also please provide your configuration or at the very least the language servers that attach when opening a C++ file

from astronvim.

c02y avatar c02y commented on June 26, 2024

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.

mehalter avatar mehalter commented on June 26, 2024

@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.

c02y avatar c02y commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.