Will langium work well with 2 ambiguous file extensions like the form of .ts
and .d.ts
?
#1527
-
Hi folks, I am building a Multiple Dependent Languages project with config like this: {
"projectName": "FormML",
"languages": [
{
"id": "formml",
"grammar": "src/language/formml/formml.langium",
"fileExtensions": [".formml"],
"textMate": {
"out": "../vscode/syntaxes/formml.tmLanguage.json"
}
},
{
"id": "formml-declaration",
"grammar": "src/language/formml-declaration/formml-declaration.langium",
"fileExtensions": [".d.formml"],
"textMate": {
"out": "../vscode/syntaxes/formml-declaration.tmLanguage.json"
}
}
],
"out": "src/language/generated"
} I prefer to name their extensions to
I have tried to build things like above and seems vscode works well on calling correct language feature for different file extensions. But I think it would be better to confirm it again here. Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @jindong-zhannng, yes, Langium generally doesn't have any issues with this, though you might need to override the shared |
Beta Was this translation helpful? Give feedback.
Hey @jindong-zhannng,
yes, Langium generally doesn't have any issues with this, though you might need to override the shared
ServiceRegistry
service. AFAIK the function we're using yields.formml
as the file extension even if it is a.d.formml
file, so it's not able to differentiate between the two services by default.