godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.52k stars 149 forks source link

Improve LSP connection behavior (fixes Godot3/4 port issue) #511

Closed DaelonSuzuka closed 10 months ago

DaelonSuzuka commented 10 months ago

This PR internally splits the LSP client connection behavior based on backend 'target". The two possible targets are HEADLESS and EDITOR

When attempting to connect to an EDITOR LSP, if the value of godotTools.lsp.serverPort is either 6005 or 6008, the client will try both ports in succession on each attempt.

The end result is that with default Godot EditorSettings and default extension settings, the language server should Just Work:tm:, no matter what version of Godot is being used.

I'm considering renaming godotTools.lsp.serverPort and godotTools.lsp.serverHost, to soft-reset users to the ideal default values.