AzureMarker / intellij-lalrpop

Jetbrains plugin for the LALRPOP parser-generator
MIT License
16 stars 2 forks source link

Running unit tests through intelliJ does not recompile or detect changes in Lalrpop grammar #53

Closed evbo closed 2 years ago

evbo commented 2 years ago

Not sure if its this plugin, but if I use IntelliJ's built-in run commands it executes without recompiling lalrpop grammar first so changes are not picked up. I don't remember this being an issue a few months ago.

As a work around, I then have to go into my Tauri app's target directory and manually delete app folders so that it recompiles: project/src-tauri/target/debug/build/app-b0b65191693b0be0

Is this in your wheel well or should I report this issue somewhere else?

AzureMarker commented 2 years ago

That's most likely not related to this plugin, since it just parses the grammar file to make editing it in your IDE easier. The actual building is all through normal Cargo mechanisms. Do you have the source publicly available, or is your build.rs more complicated than just lalrpop::process_root().unwrap();? (from the book)

evbo commented 2 years ago

Thanks I can close if not related to this repo but FWIW this is all I'm doing in build.rs:

extern crate lalrpop;

fn main() {
  lalrpop::process_root().unwrap();
  tauri_build::build()
}

And yes, following the book

AzureMarker commented 2 years ago

You could use this to ensure the build script gets rerun on changes to the grammar file, though I expect LALRPOP should be doing this already (haven't checked): https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed

AzureMarker commented 2 years ago

@evbo Your other tauri_build command is outputting rerun directives, in which case the build script isn't re-executed when the lalrpop file changes (if no rerun directives are given build.rs is rerun whenever any file changes, but once one is printed it follows the directives). By default lalrpop doesn't emit rerun directives: https://github.com/lalrpop/lalrpop/blob/d45124db36919e8a70a04581745b156fdeafbe92/lalrpop/src/api/mod.rs#L105-L109

But you can configure it to do so.