textX-LS
textX-LS copied to clipboard
Command to run generator from textX view

The idea is to have a context menu (when user right-clicks on a generator item) with following options:
- New configuration
- Uninstall generator
EDIT: Didn't find way to create context menu, I will add inline icons instead.
where New configuration option will open a new json file like:
{
"models": [
"./path/to/model"
],
"grammar": "path/to/grammar",
"ignoreCase": false,
"overwrite": false,
"outputPath": ""
}
After saving configuration file, it should be listed under appropriate generator.
Each configuration will have three actions:
- remove
- edit (json file)
- run
Extra: Configurations could be displayed using a web-view and html inside VS Code (similar like settings in VS Code itself).

A progress so far.
By default, configurations are saved under textX/generator-configurations but I will make that configurable (other fs location, database, ...).
@igordejanovic @goto40 Some thoughts/ideas?
@danixeee Here are some thoughts:
- I think that config file should have
languageandtargetas mandatory config options. Those two will decide where in the list of generators should this config file be found. grammarshould be given if language isany(like for exampledotgenerator from any model).ignoreCaseshould only be valid ifgrammaris given.
I'm rethinking the set of params to textX generators. Maybe it would be better if we have pass in file names instead of metamodel/model?
@igordejanovic Thanks for feedback.
I think that config file should have language and target as mandatory config options. Those two will decide where in the list of generators should this config file be found.
From issue description:
The idea is to have a context menu (when user right-clicks on a generator item) with following options:
- New configuration
- Uninstall generator
When user clicks on generator item, I will have language and target information. I guess I will programatically add it to the configuration file, since it will be required for running a generator.
I'm rethinking the set of params to textX generators. Maybe it would be better if we have pass in file names instead of metamodel/model?
Do you mean instead of --language and --grammar? From a file name extension we could recognise multiple matching languages, so probably --language should be kept. Or we could try to parse a model until we find a conforming one.
When user clicks on generator item, I will have language and target information. I guess I will programatically add it to the configuration file, since it will be required for running a generator.
Sounds good. So it will end up in the config file. If those values are changed then the generator will be "moved" visually under appropriate node in the generator list.
Do you mean instead of --language and --grammar? From a file name extension we could recognise multiple matching languages, so probably --language should be kept. Or we could try to parse a model until we find a conforming one.
I'm thinking about current parameters of the generators call in textX. Probably that change won't affect the CLI so if you are calling generator from CLI it should work without change. Still not sure whether we should change that though.