[3.x] Add --lsp-port
as a command line argument
#82025
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a cherry-pick of #81844 , which was accepted this week.
Implements an
--lsp-port
command line argument for Godot. This argument overrides the user's editor setting fornetwork/language_server/remote_port
.The use case for this argument would be for the godot-vscode-plugin to be able to specify the port used for the language server instance spun up by the plugin.
This would potentially solve a few long standing issues with the godot-vscode-plugin, including:
Godot's 3.x LSP port and 4.x LSP port don't match, causing the plugin to have to tell users to explicitly specify the port they have selected in their editor settings. (See godotengine/godot-vscode-plugin#473)
Spinning up multiple workspaces in vscode would cause both to use the same language server.
If the change is accepted, it should be cherry picked to 3.x. I can help with that if need be.
Let me know what things I have to change. Since this is my first time working with main.cpp and further with #ifdef and #ifndef, please pay attention to my use of those and let me know if they are up to standard.
I also added the port to the language server editor print that says --- GDScript language server started ---, changing it to --- GDScript language server started on port "port"---.
Bringing this change to 3.x will allow the godot-vscode-plugin's upcoming support for the argument to work in 3.x as well. Otherwise, the command line argument will just pass through.