Describe the problem or limitation you are having:
Release 3.2 includes Language Server Protocol. Now, as a code editor for GDScript, it has become possible to use VSCode or Atom. But LSP was implemented through WebSocket which is a little non-standard and not supported by all text editors. This PR switches the LSP from WebSocket to TCP. But some editors (for example, Kate or Qt Creator) can only work through stdio. For example, to work with Qt Creator you need to specify netcat localhost 6008 as a server.
Describe how this feature / enhancement will help you overcome this problem or limitation:
It would be great to add a CLI command such as --language-server for Godot, which would use stdio for LSP as it implemented in other LSP servers.
It would be great to add a CLI command such as --language-server for Godot, which would use stdio for LSP as it implemented in other LSP servers.
Shouldn't this be an editor setting instead of a command-line argument? Alternatively, could we make Godot start up both TCP and stdio interfaces so they can be used in a transparent manner?
Probably, yes, but almost all language servers support work through stdio. For example, here is the LSP configuration file for Kate (all of them works via stdio or have such option).
The issue here is that the way most language server work is by providing an executable to run the language server, since most language servers are standalone programs and not attached to another program as in Godot's case. I think the most reasonable solution for now is providing some sort of documentation about using netcat, as its a very lightweight program and most (if not all) linux users will have it.
Yes, I think that this will be okay too.
@ofrank123 Do you know how netcat could be used to achieve this? I could make a PR to the documentation if you don't have time to do it.
@Calinou, the following works:
nc localhost 6008
I also contributed gdscript support to upcoming build-in LSP in Neovim with this method.
Most helpful comment
@Calinou, the following works:
I also contributed gdscript support to upcoming build-in LSP in Neovim with this method.