Default language server port doesn't match with Godot 4 (#473) fix + Godot 3 back-compatibility #492
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.
I figured it would be good to update the default for Godot 4 as people seem to get caught up on it fairly frequently (#473), however there's still a lot of v3 users, so as a compromise I've added a fallback port, which it will use when it's used up half of the max connection attempts. I also doubled the number of connection attempts, so both ports get the 10 they were getting before.
By default, the main
serverPort
is the Godot 4 default, and the fallback is the Godot 3 default.I tested this code of course, but I haven't developed much for VScode or Godot before, so please scrutinise my code as much as you like.
As an aside, I noticed that the warning message at the top of the README isn't on the VSCode marketplace? Seems like the version published there might be out of date.