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

Enable LSP to parse outside scripts #55700

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

Razoric480
Copy link
Contributor

@Razoric480 Razoric480 commented Dec 7, 2021

#53308 was added as a potential fix for Godot crashing when opening scripts outside of res://, but since the last couple months, the crash no longer occurs even without the fix.

At least, not in any manner that I managed to trigger it. If someone still can, I'd like to know the specifics, but as of my testing, it's perfectly capable to handle non-res scripts just with #51332/#51333.

The fix, however, introduced the (admittedly niche, but existing often enough that we at GDQuest ran into it) issue of not being able to analyze scripts that aren't in res://, so this PR looks to revert that part of the patch.

@Razoric480 Razoric480 requested a review from a team as a code owner December 7, 2021 18:32
@YuriSizov YuriSizov added cherrypick:3.4 enhancement topic:gdscript cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Dec 7, 2021
@YuriSizov YuriSizov added this to the 4.0 milestone Dec 7, 2021
@YuriSizov
Copy link
Contributor

The fix, however, introduced the (admittedly niche, but existing often enough that we at GDQuest ran into it) issue of not being able to analyze scripts that aren't in res://, so this PR looks to revert that part of the patch.

Just to note that this is useful not just for our niche case. Many editors support syntax highlighting and static analysis on scripts that are not stored on disk. So IMO it makes sense to allow it, and if something in LSP or GDScript module in general breaks due to missing resolutions, it needs to be gracefully handled.

@akien-mga akien-mga merged commit 012b2b5 into godotengine:master Dec 9, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.1.

@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Dec 9, 2021
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.

3 participants