Hi everyone !
I am currently working on an integration of Godot and GDscript into Nova. I previously worked on SublimeText, but the quality of Nova made me want to switch.
I have already developed the LanguageDefinition extension for GDScript (which I will release once I have signed the dylib) and am currently developing (and struggling with) the Language Server Protocol part.
The configuration seemed simple to me (just a connection to a local TCP port), but I’m having trouble getting it to work.
The LSP configuration on the Godot side just consists of entering a remote host address (127.0.0.1) and a remote port (6005).
On the Nova Extension side, as the official documentation (LanguageClient) indicates, I assigned the value “socket” to the ‘type’ argument of the ServerOptions and added “–socket=6005” to ‘args’. But this doesn’t seem to work, and the error returned in the extension console is not very informative :
Error: The operation couldn’t be completed. (Nova.LanguageClient.LanguageClientError error 0.)
For information, I also tried to enter the port information as follows, without success:
–socket 6005
–port=6005
–port 6005
Here are the parts of my code in question:
// Create the client
var serverOptions = {
args: ["--socket=6005"],
path: "notUsed",
type: "socket"
};
var clientOptions = {
// The set of document syntaxes for which the server is valid
syntaxes: ['gdscript'],
debug: true
};
var client = new LanguageClient('godot', 'Godot Language Server', serverOptions, clientOptions);
try {
// Start the client
client.start();
// Add the client to the subscriptions to be cleaned up
nova.subscriptions.add(client);
this.languageClient = client;
}
catch (err) {
// If the .start() method throws, it's likely because the path to the language server is invalid
if (nova.inDevMode()) {
console.error(err);
}
}
Can you help me answer these questions:
- Do we agree that in my case I don’t need a server executable and the ‘path’ argument of the ServerOption is not useful to me ?
- If this is indeed not a problem, do you know how to properly configure the TCP port to connect to Godot ?
Thank you very much in advance and have a good weekend !