-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
LanguageServer only works with VSCode #34523
Comments
@onur I don't know much about the LSP, but the WebSocketServer, expects a valid websocket client handshake. A valid and minimal WebSocket handshake is like this:
Maybe your LanguageClient does not use websocket as a transport for LSP? |
@Faless that's the issue right there, Godot's Language Server is not actually a Language Server, it is a websocket server. According to LSP Specification a Language Server only supports two headers: Content-Lenght and Content-Type. IDK why godot requires a websocketserver on top of this. None of the clients (except godot's vscode plugin) using a protocol like this to communicate a Language Server. |
Again, not an expert on LSP, but for what I understand the protocol only
specifies the message format (with one header) but does not really specify
what kind of connection it uses. It could be raw tcp, websocket, a Unix
pipe etc.
The chosen connection for Godot was websocket. I can't say if that was the
best choice. For what I see other editors have websocket support too, but
again I don't know much about it.
Maybe @Geequlim can help here.
…On Sun, Dec 22, 2019, 19:12 Onur Aslan ***@***.***> wrote:
@Faless <https://github.com/Faless> that's the issue right there, Godot's
Language Server is not actually a Language Server, it is a websocket
server. According to LSP Specification
<https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/>
a Language Server only supports two headers: Content-Lenght and
Content-Type. IDK why godot requires a websocketserver on top of this.
None of the clients (except godot's vscode plugin) using a protocol like
this to communicate a Language Server.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34523?email_source=notifications&email_token=AAM4C3QVCQTDB6U6B7XADOLQZ6UZVA5CNFSM4J6IRXX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHPWSEY#issuecomment-568289555>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM4C3TUFMGGGSHUAX2DJXTQZ6UZVANCNFSM4J6IRXXQ>
.
|
Maybe websocket ended up being the choice because the subject was VSCode, which is built with web technology? |
I think the LSP only specifies the message content format. It doesn't force implementations to use what kind of the connection method. I choose the websocket as it is quite simple for the implementation of both the server and the client (The VSCode extention). With websocket is is easy to allow multi-clients. The LSP is designed to reduce the work of editor plugins which doesn't mean the client don't need to do anything. |
And the GDScript Language Server is not work only with VSCode but also with Atom If your client does not support Websocket there are two main ways to connect to the GDScript language servser
|
That is sad. I was waiting for godot language server thinking I would be able to use it with vim. I guess emacs folks will not be able to use it as well. (don't remember if emacs has websocket implementation) PS, don't get me wrong, I use vim now for gdscript and will continue using it no matter if godot language server would be implemented in a websocket only way. PPS, thanks for language server! |
@Geequlim How much work would it be to add LSP communication using HTTP requests? It's probably a bit slower than WebSocket, but it should be far easier to integrate into most editors. If the latency difference is large enough, we can keep both implementations. |
@Calinou I'm not sure it is possible with HTTP because both the server and the client need to send messages to each other realtime |
Not sure about HTTP, but there are language servers that does both
I don't know how websocket is different with regular socket, though |
|
I can confirm the issue. @ofrank123 told me that according to the Language Server specification, the server should accept messages starting with the lsp-mode for Emacs does only support TCP right now, but the maintainer was saying he was okay with the idea of adding web socket support. On the other hand, most language servers I've seen out there communicate over TCP. So I'd expect also most editors to expect and support TCP rather than web-sockets by default. |
I think moving to TCP makes more sense, given how much more popular it seems for language clients. I could potentially work on this but I wouldn't expect to get anything done anytime soon. Unfortunately, I've been pretty busy recently |
If there's a consensus to move to TCP and there's someone who wants to take on that, I'd gladly sponsor the work through GDQuest. That is, up to some amount at least, depending on the scope of the task, as we are running on a limited budget. @Geequlim @Faless may either of you be interested, or may you know someone who could do it? |
@NathanLovato For me it is about two full day of work to replace it to raw tcp for the server and the vscode plugin. But I can't find time to do it before February 21. |
@Geequlim Thanks for the info. 🙂 @ofrank123 said he would get a fork and PR started for that moments ago. |
Very excited to see this being looked into, thanks everyone. If there's a way to help sponsor/support the work specifically for the language server, I'd like to know. |
Work is being tracked in this PR: #35864 |
What about running two instances of vim?
…On Mon, Feb 3, 2020, 19:34 Andrew ***@***.***> wrote:
Work is being tracked in this PR: #35864
<#35864>
@ofrank123 <https://github.com/ofrank123> seems to be almost finished
with it. Their current PR doesn't support multiple clients, but we're not
sure if anybody would mind losing that functionality or not. If you do,
what's your use case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34523?email_source=notifications&email_token=AAM4C3WRITSEDXTKQJ4CHWDRBBPS7A5CNFSM4J6IRXX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKU46DI#issuecomment-581553933>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM4C3QZ2PD24D3HK5I2OFLRBBPS7ANCNFSM4J6IRXXQ>
.
|
Is that a common use case? |
@Faless Why do you need/want to run two instances of vim? Do other language servers allow this? |
Well this is quite common. I usually do have more than 1 vim instances open. And yes other, I would say most of the servers are ok with it. |
For vim it's normal to run multiple instances, e.g. use tmux or a program like tilix to have several tabs or sessions running in parallel, and to pop in and out of vim. For emacs you typically use a daemon, as with many packages it becomes slow to load. But you can run several servers or open a single gui process as well. So no problem with that. If that's enough to have two Godot projects open in parallel with completion, that sounds good to me. |
I simply have multiple terminals tab and sometimes run multiple vim
instances, this happens every day for me honestly...
…On Mon, Feb 3, 2020, 20:17 Andrew ***@***.***> wrote:
@Faless <https://github.com/Faless> Why do you need/want to run two
instances of vim? Do other language servers allow thi?s
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34523?email_source=notifications&email_token=AAM4C3WNFBEHW5NLGPFPUYDRBBUWNA5CNFSM4J6IRXX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKVBXEY#issuecomment-581573523>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM4C3TYDZLCKBBPGVBASXTRBBUWNANCNFSM4J6IRXXQ>
.
|
I could see that when working on multiple projects at once. |
I just tested your new changes and it seems to be working great, multiple clients and all! Thanks for implementing this :)
The |
Awesome! Glad to hear it's working for you! I might try messing with the VSCode and Atom plugins to see if I can get them to work, but no promises as I've never worked with those editors. |
Fantastic work everyone! I've been keeping an eye out for anything like this for probably a year now. Great to hear we've got it now. Thanks! |
@CyanBlob, it works for me too, but I also see |
I was making a quick and dirty port of the vscode extension to coc.nvim when I stumbled upon this issue, switching from websocket to tcp is awesome news ! |
I've been using Godot + Nvim, since this merge #35864, and is being a lovely experience! |
As a fellow Vim user this is excellent news! Thanks everyone! |
This was resolved in 3.2.2 by #35864, closing. Please create new issues in editor extensions' repositories if you can encounter any. |
@rafaeldelboni sorry to call you out like this, but I can't get auto-complete to work in my NVIM, would you mind sharing your how you got it to work? I added this to my Exec Flags like stated in the documentation: Not sure if I need anything else? I have tried both with coc-godot installed and without it. Neither of them works for me. :( |
Hey hello Tobias, how you doing? No problem, could you double check your godot version is above 3.2.2 and if your coc-settings is looking similar to mine? Btw you could double check my init.nvim, I don't use coc-godot, just vannila coc.nvim and some other vim plugins. I tested my setup yesterday with the current godot and everything was working fine :) |
Wow! Thanks! Using your CocConfing instantly fixed the issue for me. :) And even started showing me warnings and errors etc.! Thank you once again! Now I can finally use Godot and NeoVim together!!! :) This made my day. |
@khalid151 how does it work? In particular, what does the C-g u\ does? And what does coc#expandable() do (which didn't work for me)?
and placed it in after/ftplugin/gdscript.vim |
@sQu1rr It first checks if there's a completion menu open and there's an item selected with As I understood, |
Has anyone gotten this to work with neovim's native LSP (not CoC), for instance like these language servers: https://github.com/neovim/nvim-lspconfig? |
Anyone coming from Godot 4, note that the port has changed to 6005 and you'll want to use the filetype "gdscript": "languageserver": {
"godot": {
"host": "127.0.0.1",
"filetypes": ["gd", "gdscript"],
"port": 6005
}
} You can change your LSP settings for godot by going to And you can setup neovim as an external editor for godot by:
Now, when you click to open a gdscript file in Godot, neovim will jump to that location. |
Godot version: Godot Engine v3.2.beta4.official
OS/device including version: Debian GNU/Linux sid
Issue description:
I tried to use Godot Language Server with coc.nvim and LanguageClient-neovim clients. Godot is returning this error when clients sends
initialize
method:This is the assert line it's failing: wsl_server.cpp:49. Both clients are only sending
Content-Lenght
header and nothing else and godot is expecting more.This is the request client is sending:
cc @Faless
The text was updated successfully, but these errors were encountered: