You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When applying this plugin, you have to configure the tasks. The GenerateParserTask has the following two mandatory properties.
pathToParser
pathToPsiRoot
I was wondering why these properties are needed, and it seems that they are used only if the optional property purgeOldFiles is set to true. As the value of these properties seems to be unused in all other scenarios, I would like to not have to specify them. Also note that these properties duplicate information which is already specified in the *.bnf file. Therefore, having to specify these properties is not only unnecessary, but also opens up the possibility for inconsistent configurations.
Describe the solution you'd like
Mark pathToParser as optional
Mark pathToPsiRoot as optional
Describe alternatives you've considered
A maybe better but more elaborate change would be to remove/deprecate GenerateParserTask.purgeOldFiles, GenerateLexerTask.purgeOldFiles and the two options mentioned above. We should always delete the whole directory specified by GenerateParserTask.targetRootOutputDir and GenerateLexerTask.targetOutputDir. The selective deletion implemented right now is quite prone to misconfiguration anyway. It is also only relevant when sharing output directories between multiple tasks, which is not recommended because it can cause issues with caching.
To make the transition easier for people who are currently using a shared output directory for generateLexer and generateParser, we can provide proper defaults for GenerateParserTask.targetRootOutputDir and GenerateLexerTask.targetOutputDir. After this has been done, the only options which still need to be configured by the user are GenerateLexerTask.sourceFile and GenerateParserTask.sourceFile. To make the configuration more convenient, we can provide a property for these options in GrammarKitPluginExtension. With all these changes, the user only needs to make the following configuration for a working build:
Right now, the minimal configuration looks like the following, and it is not even working properly when a public parser rule is removed, as the generated file will not be deleted:
Is your feature request related to a problem? Please describe.
When applying this plugin, you have to configure the tasks. The
GenerateParserTask
has the following two mandatory properties.pathToParser
pathToPsiRoot
I was wondering why these properties are needed, and it seems that they are used only if the optional property
purgeOldFiles
is set totrue
. As the value of these properties seems to be unused in all other scenarios, I would like to not have to specify them. Also note that these properties duplicate information which is already specified in the*.bnf
file. Therefore, having to specify these properties is not only unnecessary, but also opens up the possibility for inconsistent configurations.Describe the solution you'd like
pathToParser
as optionalpathToPsiRoot
as optionalDescribe alternatives you've considered
A maybe better but more elaborate change would be to remove/deprecate
GenerateParserTask.purgeOldFiles
,GenerateLexerTask.purgeOldFiles
and the two options mentioned above. We should always delete the whole directory specified byGenerateParserTask.targetRootOutputDir
andGenerateLexerTask.targetOutputDir
. The selective deletion implemented right now is quite prone to misconfiguration anyway. It is also only relevant when sharing output directories between multiple tasks, which is not recommended because it can cause issues with caching.To make the transition easier for people who are currently using a shared output directory for
generateLexer
andgenerateParser
, we can provide proper defaults forGenerateParserTask.targetRootOutputDir
andGenerateLexerTask.targetOutputDir
. After this has been done, the only options which still need to be configured by the user areGenerateLexerTask.sourceFile
andGenerateParserTask.sourceFile
. To make the configuration more convenient, we can provide a property for these options inGrammarKitPluginExtension
. With all these changes, the user only needs to make the following configuration for a working build:Right now, the minimal configuration looks like the following, and it is not even working properly when a public parser rule is removed, as the generated file will not be deleted:
PS: I would be willing to prepare a PR with either of the two solutions.
The text was updated successfully, but these errors were encountered: