-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rosetta): non-compiling snippets not reported on subsequent extra…
…cts (#3260) Picture this scenario: there is a non-compiling snippet in a README.md file. I run `yarn rosetta:extract --compile` and it returns diagnostics as expected. Behind the scenes, `.jsii.tabl.json` gets created as a cache, and this snippet is inserted into that file with `didCompile = false`. _Without making any changes_, I run `yarn rosetta:extract --compile` again. This time, no diagnostics are returned, and it looks like my errors have magically fixed themselves. However what is really happening is that `extract` is finding a snippet in the cache that matches the offending snippet (since I changed nothing). It is then filtering out that cached snippet, meaning we do not actually try to compile the snippet again. This is bad; `extract` should honor the `--compile` flag and return errors the second time around too. There are two ways to solve this (that I can think of): we can return diagnostics for cached snippets as well, or we can ignore non-compiling cached snippets when `--compile` is set. I have opted for the second solution for this reason: it is possible that I am intending to rerun the same snippet with the expectation that I have changed _something else_ that will result in a successful compilation (for example, I add an import to the fixture). Open to dialogue about this. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
- Loading branch information
Showing
3 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters