Macro doesn't execute when defined in a project outside of analysis roots #55670
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
feature-macros
Implementation of the macros feature
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
I was investigating an issue @mit-mit / @davidmorgan are seeing of macros not executing in VS Code. I can reproduce the issue and it seems to be that when the project that contains a macros definition is not in the workspace, the macro does not execute.
Here's a repro:
https://github.com/DanTup/macro-other-project-issue
This project has two projects:
my_macro
- defines a macro@WithMethod(name)
that adds a method to a classmy_macro_user
- defines a classA
annotated with@WithMethod('hello)
to add a method calledhello
If I open the entire repository in VS Code, the macro executes fine (I can hover over and jump to the definition):
However, if I open only the
my_macro_user
folder (so that the definition of the macro is not in the workspace), the macro doesn't execute (and no errors are shown in VS Code or in the instrumentation log):@mit-mit was using latest Flutter
master
and I repro'd onDart SDK version: 3.5.0-edge.8ef0e2a15805d3b79c64c3998fa1c9500f3654d0 (main) (Mon May 6 23:57:19 2024 +0000) on "windows_x64"
.The text was updated successfully, but these errors were encountered: