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

Change gdscript-eglot-version type to be string instead of integer #155

Merged

Conversation

katomuso
Copy link
Contributor

@katomuso katomuso commented Nov 2, 2024

Customizable variable gdscript-eglot-version is used to locate editor settings file and extract LSP port from it when connecting via Eglot. Currently, this variable is of type integer.

In godotengine/godot#90875, naming logic for the editor settings file was changed, and if you have, for example, Godot 4.3 installed, the corresponding editor settings file will be named editor_settings-4.3.tres. Because gdscript-eglot-version has an integer type and is formatted as such, it is impossible to specify the correct version of the Godot installation in that case.

I changed the type of gdscript-eglot-version to a string to be able to specify any possible version format. Also, I've bumped the value of gdscript-eglot-version to the last stable version of Godot. As stated in #154, we can improve LSP port determination further by avoiding hard-coding this value, but this is good enough for now.

@NathanLovato NathanLovato merged commit 52b3637 into godotengine:master Nov 2, 2024
13 checks passed
@NathanLovato
Copy link
Collaborator

Thank you for your contribution!

@katomuso katomuso deleted the tweak-gdscript-eglot-version branch November 3, 2024 09:58
@okuriashi
Copy link

Doesn't this effectively close #154?. 🤔 My comment #154 (comment) was intended as a solution but @katomuso beat me to the PR 🙇

It seems to me that the change to support older versions and >= 4.3 vesions of the settings file, together with the gdscript-eglot-version customizable variable, we have everything we need?

The mentioned scenario of multiple Godot versions seems to me an edge case, although I might be way off here as I'm not by any means a professional Godot user.

One might consider having a default for the port, but I think it's fine to assume that the configuration file is well formed. If it's not, it's always possible to provide eglot with host and port directly.

I don't think it's emacs-gdscript-mode responsibilty to try and cover all possible scenarios for Godot installations and bugs 😉 🙇

@NathanLovato
Copy link
Collaborator

Thank you for all the details @okuriashi !

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

Successfully merging this pull request may close these issues.

4 participants