Skip to content
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

[3.x] Add --lsp-port as a command line argument #82025

Merged

Conversation

ryanabx
Copy link
Contributor

@ryanabx ryanabx commented Sep 21, 2023

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 for network/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.

@ryanabx ryanabx requested review from a team as code owners September 21, 2023 04:49
@akien-mga akien-mga merged commit 5271c97 into godotengine:3.x Sep 21, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants