Customize validator and generator using workspace.ConfigurationProvider #1651
-
My DSL needs some project dependent configuration, like for example:
The settings should work the same: in LS (VS Code/Eclipse/....) and in CLI generator. I looked into using But Is there some working solution/example of how to deal with settings in Langium DSLs? Or sould I implement my own configuration, which is independend from LS and VSCode features? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @borisbrodski, the configuration you're talking about is essentially a compiler configuration. Most programming languages (like TypeScript's In general, you shouldn't use compiler options as language server configuration items. As you've already seen, reading those in a CLI is effectively impossible and there's even one more important argument: The language server provides language services to an IDE. Therefore, unless absolutely necessary, only language service related configurations should appear as configuration items (i.e. stuff like whether certain code lenses should appear, etc.). |
Beta Was this translation helpful? Give feedback.
-
Hey Mark, thank you for quick response! This makes a lot of sense. How would you implement loading
I would rather write an additional service like I have following in my
|
Beta Was this translation helpful? Give feedback.
Hey @borisbrodski,
the configuration you're talking about is essentially a compiler configuration. Most programming languages (like TypeScript's
tsconfig.json
) feature a separate configuration format for that. The CLI and the language server would both read that file to determine the compiler options.In general, you shouldn't use compiler options as language server configuration items. As you've already seen, reading those in a CLI is effectively impossible and there's even one more important argument: The language server provides language services to an IDE. Therefore, unless absolutely necessary, only language service related configurations should appear as configuration items (i.e. st…