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

fix: try to infer languageId from extension when invalid provided #799

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

rchl
Copy link
Member

@rchl rchl commented Nov 13, 2023

Fixup languageId if an invalid one was provided when opening a document.

4.1 version of the server started being more strict about that and stopped accepting invalid languageId. Since this wasn't an intentional breaking change and because it wasn't a major/breaking release, introduce code that automatically infers correct ID from file extension so that there are no disruptions for clients that don't send correct ID.

This compatibility layer will be removed in the next major release.

Fixes #794

Copy link
Contributor

size-limit report 📦

Path Size
lib/cli.mjs 782.27 KB (+0.11% 🔺)

@rchl rchl changed the title fix: try to fallback to valid languageId when invalid provided fix: try to infer languageId when invalid provided Nov 13, 2023
@rchl rchl changed the title fix: try to infer languageId when invalid provided fix: try to infer languageId from extension when invalid provided Nov 13, 2023
@rchl rchl merged commit 994186e into master Nov 13, 2023
7 checks passed
@rchl rchl deleted the fix/fallback-ext branch November 13, 2023 19:24
@HIRANO-Satoshi
Copy link

Could you kindly make a quick release with this?

I guess so many users are wasting time to find the reason of failure as we did.

And I would like to ask you not to remove this.

@rchl
Copy link
Member Author

rchl commented Nov 14, 2023

Could you kindly make a quick release with this?

I guess so many users are wasting time to find the reason of failure as we did.

And I would like to ask you not to remove this.

Released now.

Note that, as said in #794 (comment), this is just a stop gap to not break clients that don't send correct languageId and the plan is to remove this stop gap in the next major release (which is likely not gonna be released anytime soon). As said in the linked comment, the proper solution is for clients or client configurations to get updated to send a correct ID.

@HIRANO-Satoshi
Copy link

Thanks a lot.

You are right, but it's a fallback.

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.1.0: didOpen fails for .tsx with "Cannot open document"
2 participants