Это мой старый config.yaml (хорошо работал с C):
Код: Выделить всё
CompileFlags:
Compiler: x86_64-w64-mingw32-gcc
Add: ["-I../headers", "-I$INCLUDE_PATH"]
Вот мой новый config.yaml:
Код: Выделить всё
If:
PathMatch: .*\.c .*\.h
CompileFlags:
Compiler: x86_64-w64-mingw32-gcc
Add: ["-I../headers", "-I$INCLUDE_PATH"]
---
If:
PathMatch: .*\.cpp .*\.hpp
CompileFlags:
Compiler: x86_64-w64-mingw32-g++
Add: ["-I../headers", "-I$INCLUDE_PATH"]
---

[Изменить]: я не заметил, что не использовал пространство имен std.
Несмотря на то, что он компилируется без каких-либо проблем.
Это журнал neovim LSP, если он может помочь.
Код: Выделить всё
[START][2024-05-01 19:22:24] LSP logging initiated
[ERROR][2024-05-01 19:22:24] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:24.429] clangd version 17.0.3 (https://github.com/llvm/llvm-project 888437e1b60011b8a375dd30928ec925b448da57)\nI[19:22:24.429] Features: linux+grpc\nI[19:22:24.429] PID: 1238686\nI[19:22:24.429] Working directory: /home/panda/path/to\nI[19:22:24.429] argv[0]: /home/panda/.local/share/nvim/mason/bin/clangd\nI[19:22:24.429] Starting LSP over stdin/stdout\nI[19:22:24.429] reply:initialize(1) 0 ms\n"
[ERROR][2024-05-01 19:22:24] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:24.431] workspace/semanticTokens/refresh(0)\n"
[ERROR][2024-05-01 19:22:24] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:24.679] Indexing c++17 standard library in the context of /home/panda/path/to/main.cpp\n"
[ERROR][2024-05-01 19:22:24] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:24.679] textDocument/publishDiagnostics\n"
[ERROR][2024-05-01 19:22:24] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:24.689] reply:textDocument/signatureHelp(2) 2 ms\n"
[ERROR][2024-05-01 19:22:25] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:25.962] Indexed c++17 standard library (incomplete due to errors): 13604 symbols, 1918 filtered\n"
[ERROR][2024-05-01 19:22:26] .../vim/lsp/rpc.lua:734 "rpc" "/home/panda/.local/share/nvim/mason/bin/clangd" "stderr" "I[19:22:26.750]
Подробнее здесь: [url]https://stackoverflow.com/questions/78415881/clangd-issues-with-mingw[/url]
Мобильная версия