FacilityApi / FacilityIntellij

Provides syntax highlighting and language support for Facility Service Definition (fsd) files for the Facility API Framework.
MIT License
0 stars 3 forks source link

add optional semicolon to cfg #71

Open bryankenote opened 8 months ago

bryankenote commented 8 months ago

Fixes #70

bryankenote commented 8 months ago

Seeing these errors when trying to gen the lexer or parser

Some problems were found with the configuration of task ':generateLexer' (type 'GenerateLexerTask').
  - In plugin 'org.jetbrains.grammarkit' type 'org.jetbrains.grammarkit.tasks.GenerateLexerTask' property 'source' doesn't have a configured value.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 62ms
1 actionable task: 1 executed
Some problems were found with the configuration of task ':generateParser' (type 'GenerateParserTask').
  - In plugin 'org.jetbrains.grammarkit' type 'org.jetbrains.grammarkit.tasks.GenerateParserTask' property 'parserFile' doesn't have a configured value.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 60ms
1 actionable task: 1 executed
jzbrooks commented 8 months ago

Early on I tried using the grammar kit's grade plugin to do that generation. IIRC, at some point or other those tasks even ran automatically during the build so generated code was always ephemeral, which was nice. Memory is fuzzy but I bailed on that because the plugin didn't support some features of grammar kit. https://github.com/FacilityApi/FacilityIntellij/pull/1#issuecomment-951457494 The bespoke lexer generator task (generateFsdLexer) is still in there.

./gradlew tasks is misleading. It might be worthwhile to remove the grammar kit plugin from the build so it doesn't add those tasks to the project.

I typically used the grammar kit plugin in IntelliJ to regenerate the lexer and parser code.

Screenshot 2024-01-10 at 9 00 52 PM

You're probably going to need to update _FsdLexer.flex also. It annoyed me that the lexer was so involved, but it was the best way I could come up with to correctly tokenize method as a keyword in some syntactical contexts and as an annotation parameter name elsewhere (the HTTP annotation, I think).