eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
663 stars 61 forks source link

Track unknown documents via language id #1492

Closed msujew closed 1 month ago

msujew commented 1 month ago

This is a second iteration on the fix of https://github.com/eclipse-langium/langium/pull/1455. This idea came up while helping with https://github.com/eclipse-langium/langium/discussions/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).