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

Track unknown documents via language id #1492

Merged
merged 4 commits into from May 14, 2024
Merged

Conversation

msujew
Copy link
Contributor

@msujew msujew commented May 10, 2024

This is a second iteration on the fix of #1455. This idea came up while helping with #1488: The TextDocument is always aware of the language ID used in the language client, even if the file extension doesn't fit. We can use that info (assuming a TextDocument instance is available for the given URI) to make the ServiceRegistry more accurate.

This also fixes issues experienced when creating an untitled file and setting the language to a DSL language (in multi-language projects).

@msujew msujew added the polish Some feature needs improvement label May 10, 2024
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement!

packages/langium/src/service-registry.ts Outdated Show resolved Hide resolved
packages/langium/src/service-registry.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@msujew msujew merged commit 5762a08 into main May 14, 2024
5 checks passed
@msujew msujew deleted the msujew/language-id-tracking branch May 14, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Some feature needs improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants