-
-
Notifications
You must be signed in to change notification settings - Fork 18
Replace dependency while waiting for fix to be merged #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CLA assistant check
All committers have signed the CLA.
9e8f1bb
to
1edd40a
Compare
1edd40a
to
6064dc3
Compare
It should be noted that this would cause go install github.com/arduino/arduino-language-server@...
to no longer work:
-> speelbarrow ~/Git/arduino-language-server (main) ✓ go install github.com/speelbarrow/arduino-language-ser
ver@v0.0.0-20241103180208-6064dc30028f
go: downloading github.com/speelbarrow/arduino-language-server v0.0.0-20241103180208-6064dc30028f
go: github.com/speelbarrow/arduino-language-server@v0.0.0-20241103180208-6064dc30028f (in github.com/speelba
rrow/arduino-language-server@v0.0.0-20241103180208-6064dc30028f):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
If you choose not to merge this PR for that reason, I request that you at least leave it open so that others using Neovim v0.10+ can find this fix.
Workaround install instructions are:
git clone https://github.com/speelbarrow/arduino-language-server.git
cd arduino-language-server
go install
diffusive0047
commented
Nov 6, 2024
It should be noted that this would cause
go install github.com/arduino/arduino-language-server@...
to no longer work:-> speelbarrow ~/Git/arduino-language-server (main) ✓ go install github.com/speelbarrow/arduino-language-ser ver@v0.0.0-20241103180208-6064dc30028f go: downloading github.com/speelbarrow/arduino-language-server v0.0.0-20241103180208-6064dc30028f go: github.com/speelbarrow/arduino-language-server@v0.0.0-20241103180208-6064dc30028f (in github.com/speelba rrow/arduino-language-server@v0.0.0-20241103180208-6064dc30028f): The go.mod file for the module providing named packages contains one or more replace directives. It must not contain directives that would cause it to be interpreted differently than if it were the main module.
If you choose not to merge this PR for that reason, I request that you at least leave it open so that others using Neovim v0.10+ can find this fix.
Workaround install instructions are:
git clone https://github.com/speelbarrow/arduino-language-server.git cd arduino-language-server go install
Hey,
thanks for your pr!
this workaround doesn"t fix the version problem which is currently in nvim 0.1.x or do I miss here something?
Just tried it and got the same errors as in the original verison.
Damn, why is this lsp stuff such a mess!
this workaround doesn"t fix the version problem which is currently in nvim 0.1.x or do I miss here something? Just tried it and got the same errors as in the original verison. Damn, why is this lsp stuff such a mess!
@diffusive0047 This workaround allows the language server to properly attach to the buffer, which lets it work at all. The message in :LspInfo
that I'm assuming you're referring to doesn't get in the way of the language server operating (as far as I can tell). But please let me know if I'm misunderstanding what error you're talking about and I'll look into it further.
Hi @speelbarrow I just tested this and it is working for me. Also had to use clangd
from my system, as there were issues with the one provided by Mason.
Edit: no, apparently it is not working. I was sure that the buffer was attached first, but now not any more :/ .
Edit 2:
Here are some logs:
[ERROR][2024年12月04日 22:05:48] .../vim/lsp/rpc.lua:770 "rpc" "/usr/bin/arduino-language-server" "stderr" "22:05:48.564987 INIT --- : error starting clang: running --config-file /home/tapia/.arduino15/arduino-cli.yaml compile --fqbn --only-compilation-database --source-override /tmp/1085483171 --build-path /tmp/arduino-language-server2147930507/fullbuild --format json /home/tapia/Arduino/test-nano: exit status 1
22:05:48.565018 textDocument/didOpen: locked (waiting clangd)
22:05:48.565024 textDocument/didOpen: clangd startup failed: quitting Language server
"
Hi @cristobaltapia!
@speelbarrow 's solution worked for me. Below is the course I followed to make it work. I am not sure if it's the most optimal way to go about it but it worked for me at least.
I cloned speelbarrow's repo in /tmp, entered the arduino-language-server directory and ran:
go install
go build
I then navigated to ~/.local/share/nvim/mason/bin, deleted the arduino-language-server symlink created by Mason and then created a new symlink to /tmp/arduino-language-server/arduino-language-server. I used clangd from Mason in my config.
My lsp.lua:
local lspconfig = require('lspconfig') require('lspconfig').arduino_language_server.setup { cmd = { "/Users/valentino/.local/share/nvim/mason/bin/arduino-language-server", "-clangd", "/Users/valentino/.local/share/nvim/mason/bin//clangd", "-cli", "/usr/local/bin/arduino-cli", "-cli-config", "/Users/valentino/Library/Arduino15/arduino-cli.yaml", "-fqbn", "arduino:renesas_uno:unor4wifi" }, root_dir = lspconfig.util.root_pattern("*.ino"), filetypes = { "arduino" }, autostart = true, log_level = vim.lsp.protocol.MessageType.Log, settings = { arduino_language_server = { log = { verbosity = "debug" } } } }
My environment:
OS: macOS 14.6.1
Neovim: v0.10.2
arduino-cli: 1.1.0
clangd (from Mason): 19.1.0
With these steps, the ALS attaches to the buffer when i open an .ino file in Neovim. Hope this is any help :)
MatthewWinnan
commented
Dec 14, 2024
Hi @speelbarrow.
I tested the proposed fix and I am obtaining the same errors as mentioned by @cristobaltapia.
I am including the arduino-language-server logs as well as the similar line under the lsp logs.
[ERROR][2024年12月14日 19:56:28] .../vim/lsp/rpc.lua:770 "rpc" "/nix/store/z4r1jsjvm4byqkfnlci2cl3kpad0pisk-arduino-language-server-latest/bin/arduino-language-server" "stderr" '19:56:28.856249 27円[96mINIT --- : error starting clang: running --config-file /home/matthew/.arduino15/arduino-cli.yaml compile --fqbn "nRFMicro-like Boards:nrf52:supermini" --only-compilation-database --source-override /tmp/3346771869 --build-path /tmp/arduino-language-server1204308188/fullbuild --format json /home/matthew/Arduino/SOFLE_FIRMWARE: exit status 127円[0m\n19:56:28.856392 27円[92m textDocument/didOpen: 27円[93mlocked (waiting clangd)27円[0m27円[0m\n19:56:28.856402 27円[92m textDocument/didOpen: clangd startup failed: quitting Language server27円[0m\n'
All that I am noticing is is that the following notifications generated by my sketch is not being propagated to clangd:
"commands":["clangd.applyFix","clangd.applyTweak"]}
Unfortunately this is quite out of my domain, I hope the logs at least provide some use.
My environment is:
- NVIM v0.10.1
- Build type: Release
- LuaJIT 2.1.1713773202
- clangd version 19.1.0-rc3
- Features: linux
- Platform: x86_64-unknown-linux-gnu
- arduino-cli Version: 1.0.4
brandoncc
commented
Mar 19, 2025
Please consider merging this since it makes the language server usable in neovim. It would have been a much nicer experience if the mason install had just worked, but I had to customize the command to use speelbarrow's fork.
Uh oh!
There was an error while loading. Please reload this page.
Please check if the PR fulfills these requirements
Replaces the dependency on bugst/go-lsp with a patched version created by @mike-lloyd03 and organized together with the latest upstream commits by myself. This is a temporary measure to restore compatibility with Neovim v0.10+ while waiting for Fix for nvim 10+ bugst/go-lsp#5 to be merged.
Because bugst/go-lsp's
go.mod
file has been updated to Go 1.22, I have also updated this package'sgo.mod
from Go 1.21.5 to Go 1.22.8. In order to keep the Actions running, I've updated the Go version in DistTasks.yml as well.Arduino LS "rpc.lua" problem with neovim #186 .
What is the new behavior?
Resolves Arduino LS "rpc.lua" problem with neovim #186 .
Other information:
I'd like to re-iterate that this is @mike-lloyd03's fix from nvim-lspconfig + arduino-language-server doesn't attach to buffer #187 , not mine. I've just packaged it all together with the latest commits from bugst/go-lsp to make this PR.