arduino / arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
GNU Affero General Public License v3.0
120 stars 11 forks source link

No support for neovim / Coc #99

Closed beyarkay closed 1 year ago

beyarkay commented 2 years ago

Bug Report

Current behavior

Currently, there's no way to get language server in neovim via Coc

Expected behavior

It would be amazing to have hints and language support in neovim via Coc

Environment

drank40 commented 2 years ago

It used to work flawlessy, this is a regression

beyarkay commented 2 years ago

@drank40 can you confirm the steps you used to you used to install it as a language server?

drank40 commented 2 years ago

I followed https://github.com/neoclide/coc.nvim/wiki/Language-servers#[Arduino](https://github.com/neoclide/coc.nvim/wiki/Language-servers#Arduino)

I just added this lines to my coc-settings.json and it worked, but it appears to be broken now, since the language server closes the connection at every request

drank40 commented 2 years ago

See

https://github.com/neoclide/coc.nvim/issues/3594#issuecomment-1046250743

steprobe commented 2 years ago

I am seeing the same thing on Ubuntu. Is this really an enhancement? Seems more like a bug, and as @drank40 points out a regression.

atrosekta commented 1 year ago

same here too, coc's logs says the server is repeatedly stopping as soon as it start ,same with nvim lsp, tho i can launch the server "by hand" without it stopping

chmanie commented 1 year ago

For me, using nvim-lsp, it does run for some time but then crashes intermittently. Are we talking about the same issue or is this different behavior?

dbmzzo commented 1 year ago

For me, using nvim-lsp, it does run for some time but then crashes intermittently.

This is the behavior I'm seeing as well, using nvim-lspconfig.

beyarkay commented 1 year ago

@per1234 @cmaglie is this issue likely to be fixed in the near future? Or alternatively, is the repository accepting PRs?

per1234 commented 1 year ago

is the repository accepting PRs?

Yes. We have already received some high quality PRs which resulted in valuable contributions to the Arduino Language Server project.

One thing that should be noted is that the primary purpose of this project is to serve as the language server component of Arduino IDE 2.x. The use of the standardized language server protocol makes it a general purpose tool that can be used in other applications and it is very cool that people are already using it in such alternative applications. However, that use case will always be a lower priority for the project relative to the use in the development tools created by Arduino such as Arduino IDE 2.x.

beyarkay commented 1 year ago

So reading between the lines, support for non-arduino editors is not available, but the project is willing to accept (high quality) PRs if they add that support?

(I'll take silence to mean a yes)

beyarkay commented 1 year ago

Sorry I'm realising that comment could come across a little aggressive, which is not my intention at all. Just wanting to get a clear idea of the state of support for non-arduino features before I go and try fix the problem myself.

Thanks for the help!

adamansky commented 1 year ago

All what you need is a proper compile_commands.json in your sketch directory and CoC + cland installed with vim/neovim

Take look on my small utility project which brings me code completion for Arduino projects https://github.com/Softmotions/acdb

attilastrba commented 1 year ago

All what you need is a proper compile_commands.json in your sketch directory and CoC + cland installed with vim/neovim

Can you explain a bit more? I have a proper compile_commands.json still the server is crashing. I am using Neovim, arduino_cli v0.26.0 and compiled the language server from scratch. If I don't provide the arduino_cli path then is all ok. I am unable to get any log with the -log function.

Thank you

adamansky commented 1 year ago

still the server is crashing

Along with compler_commans.json in project root just use coc-clangd as a language server and associate .ini files with cpp

let g:coc_filetype_map = {
  \ 'ino': 'cpp',
  \ }
attilastrba commented 1 year ago

Thank you. You mean that I don't need the whole arduino-language-server stuff and just work with clangd?

adamansky commented 1 year ago

Sure!

Thank you. You mean that I don't need the whole arduino-language-server stuff and just work with clangd? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

per1234 commented 1 year ago

Closing a duplicate of the other issues we have about neovim/coc: