Open fira42073 opened 1 week ago
not sure if that was the right label, please feel free to fix it
as far as I understand, we will need something like
this in registry
---
name: buf-ls
description: |
buf cli tool's builtin lsp server.
homepage: https://github.com/bufbuild/buf
licenses: [Apache-2.0]
languages: [Protobuf]
categories: [LSP]
source:
id: pkg:golang/github.com/bufbuild/buf@v1.46.0#cmd/buf
bin:
buf: golang:buf
Also perhaps update to add buf_ls, so that it's aligned with lspconfig https://github.com/williamboman/mason-lspconfig.nvim/blob/main/lua/mason-lspconfig/mappings/filetype.lua#L157
This may be a different issue, may be related, I'm not sure, but Even if that worked, clangd tries to do something and that yields this error in lsp log
[START][2024-11-13 01:55:06] LSP logging initiated
[ERROR][2024-11-13 01:55:06] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:06.988] clangd version 19.1.0 (https://github.com/llvm/llvm-project a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)\nI[01:55:06.988] Features: linux+grpc\nI[01:55:06.988] PID: 2055070\nI[01:55:06.988] Working directory: /home/fira/Projects/xxx\nI[01:55:06.988] argv[0]: /home/fira/.local/share/nvim/mason/bin/clangd\nI[01:55:06.988] Starting LSP over stdin/stdout\nI[01:55:06.988] <-- initialize(1)\nI[01:55:06.989] --> reply:initialize(1) 0 ms\n"
[ERROR][2024-11-13 01:55:07] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:07.032] <-- initialized\nI[01:55:07.032] <-- textDocument/didOpen\nI[01:55:07.032] Failed to find compilation database for /home/fira/Projects/xxx/xxx.proto\nI[01:55:07.032] ASTWorker building file /home/fira/Projects//xxx/xxx.proto version 0 with command clangd fallback\n[/home/fira/Projects/xxx]\n/usr/bin/clang -resource-dir=/home/fira/.local/share/nvim/mason/packages/clangd/clangd_19.1.0/lib/clang/19 -- /home/fira/Projects/xxx/xxx.proto\nE[01:55:07.033] Could not build CompilerInvocation for file /home/fira/Projects/xxx/xxx.proto\nI[01:55:07.033] --> textDocument/publishDiagnostics\nI[01:55:07.033] <-- textDocument/inlayHint(2)\nI[01:55:07.033] --> reply:textDocument/inlayHint(2) 0 ms, error: invalid AST\nI[01:55:07.038] <-- textDocument/documentSymbol(3)\nI[01:55:07.038] --> reply:textDocument/documentSymbol(3) 0 ms, error: invalid AST\nI[01:55:07.038] <-- textDocument/documentSymbol(4)\nI[01:55:07.038] --> reply:textDocument/documentSymbol(4) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:07] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:07.046] <-- textDocument/inlayHint(5)\nI[01:55:07.046] --> reply:textDocument/inlayHint(5) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:07] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:07.048] <-- textDocument/semanticTokens/full(6)\nI[01:55:07.048] --> reply:textDocument/semanticTokens/full(6) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:07] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:07.334] <-- textDocument/documentHighlight(7)\nI[01:55:07.334] --> reply:textDocument/documentHighlight(7) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:07] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:07.543] <-- textDocument/inlayHint(8)\nI[01:55:07.543] --> reply:textDocument/inlayHint(8) 0 ms, error: invalid AST\n"
[WARN][2024-11-13 01:55:08] ...lsp/handlers.lua:625 "[certificates] Failed to parse certificate # ACCVRAIZ1\n Error: error:0480006C:PEM routines::no start line\n at new X509Certificate (node:internal/crypto/x509:119:21)\n at /home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:79:36\n at Array.filter (<anonymous>)\n at Cle.removeExpiredCertificates (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:77:32)\n at Cle.getAllRootCAs (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:68:38)\n at Rge.createSecureContext (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificates.ts:46:23) {\n opensslErrorStack: [\n 'error:0688010A:asn1 encoding routines::nested asn1 error',\n 'error:06800066:asn1 encoding routines::bad object header',\n 'error:0680009B:asn1 encoding routines::too long'\n ],\n library: 'PEM routines',\n reason: 'no start line',\n code: 'ERR_OSSL_PEM_NO_START_LINE'\n}"
[WARN][2024-11-13 01:55:08] ...lsp/handlers.lua:625 "[certificates] Failed to parse certificate # ACCVRAIZ1\n Error: error:0480006C:PEM routines::no start line\n at new X509Certificate (node:internal/crypto/x509:119:21)\n at /home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:79:36\n at Array.filter (<anonymous>)\n at Cle.removeExpiredCertificates (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:77:32)\n at Cle.getAllRootCAs (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificateReaders.ts:68:38)\n at Rge.createSecureContext (/home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/lib/src/network/certificates.ts:46:23) {\n opensslErrorStack: [\n 'error:0688010A:asn1 encoding routines::nested asn1 error',\n 'error:06800066:asn1 encoding routines::bad object header',\n 'error:0680009B:asn1 encoding routines::too long'\n ],\n library: 'PEM routines',\n reason: 'no start line',\n code: 'ERR_OSSL_PEM_NO_START_LINE'\n}"
[ERROR][2024-11-13 01:55:08] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:08.584] <-- textDocument/documentHighlight(9)\nI[01:55:08.584] --> reply:textDocument/documentHighlight(9) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:09] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:09.051] <-- textDocument/documentHighlight(10)\n"
[ERROR][2024-11-13 01:55:09] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:09.051] --> reply:textDocument/documentHighlight(10) 0 ms, error: invalid AST\n"
[ERROR][2024-11-13 01:55:10] .../vim/lsp/rpc.lua:770 "rpc" "/home/fira/.local/share/nvim/mason/bin/clangd" "stderr" "I[01:55:10.371] <-- textDocument/documentHighlight(11)\nI[01:55:10.371] --> reply:textDocument/documentHighlight(11) 0 ms, error: invalid AST\n"
LspInfo
==============================================================================
lspconfig: require("lspconfig.health").check()
LSP configs active in this session (globally) ~
- Configured servers: clangd, ts_ls, pylsp, golangci_lint_ls, terraformls, gitlab_ci_ls, jsonls, gopls, lua_ls
- OK Deprecated servers: (none)
LSP configs active in this buffer (bufnr: 1) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `proto`
- 2 client(s) attached to this buffer
- Client: `copilot` (id: 1, bufnr: [1])
root directory: ~/Projects/xxx/
filetypes:
cmd: ~/Projects/xxx/node /home/fira/.local/share/nvim/site/pack/packer/start/copilot.lua/copilot/index.js
version: `v20.17.0`
executable: true
autostart: false
- Client: `clangd` (id: 2, bufnr: [1])
root directory: ~/Projects/xxx/
filetypes: c, cpp, objc, objcpp, cuda, hpp
cmd: ~/.local/share/nvim/mason/bin/clangd
version: `clangd version 19.1.0 (https://github.com/llvm/llvm-project a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)`
executable: true
autostart: true
Also, no clue how to change the filetype association.
require("mason-lspconfig").setup_handlers({
function(server_name)
if server_name == "clangd" then
require("lspconfig")[server_name].setup({
capabilities = lsp_capabilities,
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "hpp" },
})
end
end,
})
I tried this.
Also googled and found this stuff, but it didn't help, it just overrides it on start and lsplog shows proto filetype for clangd.
https://www.reddit.com/r/neovim/comments/15s54hf/how_to_add_a_file_type_to_a_language_server/
Is there a workaround?
First of all, thanks for this great project <3
Problem description
bufls is deprecated, use buf_ls instead. Feature will be removed in lspconfig 0.2.1
mason does not support buf_ls
Why do you think this is an issue with mason-lspconfig.nvim?
new change?
Neovim version (>= 0.7)
NVIM v0.10.1 Build type: RelWithDebInfo LuaJIT 2.1.1720049189 Run "nvim -V1 -v" for more info
Operating system/version
Linux fedorapc 6.10.12-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 30 21:38:25 UTC 2024 x86_64 GNU/Linux
I've manually reviewed the Nvim LPS client log (
:LspLog
) to find potential errorsI've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig
Affected language servers
bufls/buf_ls
Steps to reproduce
Actual behavior
Not relevant
Expected behavior
Not relevant
LspInfo
LspLog
No response
Healthcheck
Screenshots or recordings
No response