-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[analyzer_plugin] Running build_runner does not invoke analysis.updateContent
with the newly generated files in VScode
#54113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It appears that instead of deleting the It may be that for all file changes triggered by the terminal, analyzer_plugin isn't notified. |
Definitely something we will need to get right in the new plugin implementation. |
Is there a new implementation in progress? |
We're in the design phase, and once we have a design we can make a decision about whether we will implement it. |
Are you aware of a possible workaround to this issue? |
Assuming that the server is already watching the files in the directory that build_runner writes to, the fix would be to make sure that those changes are passed along to the plugins. As for a workaround, that would probably be for each plugin to create their own watcher on that directory and tell the |
I'd love to fix it in the SDK directly. But I'm not sure where to even look at. Do you maybe have any tips on how to get started here? |
The
I don't know how much that helps, though. Note that our use of the watcher package is wrapped so that we can use it from the |
About this, is there a document detailing how to use the local clone of I have tests running and was looking into forking |
I don't really have time to work on this, as you've seen. But it's a pretty important bug. I see users complain about this about every week. |
Hello!
It appears that when generated files are generated using build_runner, analyzer_plugins do not receive a
analysis.updateContent
matching the generation.Steps to reproduce:
{type: remove}
)build_runner build -d
.g.dart
file will be re-created. But noanalysis.updateContent
with{type: add}
will be sentThis means that subsequent
getFixes
/getsAssists
behave as if code-generation did not happen.Here's a video showcasing the problem.
dependencies.g.dart
. This correctly updates lints due to missing generated files.We see in the bottom of the screen at that point that an
updateContent
was sent, with the content of the generated file.dart run build_runner build -d
.The
dependencies.g.dart
reappeared. But as you can see in the logs, noupdateContent
request was sent. So the IDE behaves as if the generated file is still missing.updateContent
.Screen.Recording.2023-11-21.at.11.47.16.mov
The text was updated successfully, but these errors were encountered: