Skip to content

Conversation

@szotp
Copy link
Contributor

@szotp szotp commented Oct 6, 2019

This is slightly related to #1970.

Ideally it would not be needed, but I had few situations where I had to run "reload window" because analyzer was not handling updated packages, etc.

So instead of "reload window" I could just force the analyzer to reanalyze. The additional bonus is that other extensions can also run this command, which will be useful for my extension for r_flutter.

I basically copied the implementation of dart.openAnalyzerDiagnostics so there are no tests or anything because the original command didn't have them.

@DanTup
Copy link
Member

DanTup commented Oct 7, 2019

Ideally it would not be needed, but I had few situations where I had to run "reload window" because analyzer was not handling updated packages, etc.

The best fix here is to resolve those issues. This has come up before, but this is a workaround I would prefer not to have. If implemented, people would just use it without raising issues for the underlying bugs, and then complain that the extension is buggy and you have to keep reloading.

So, this should be considered a last resort and we should push on the other bugs first. If we hit blockers that mean they can't all be solved, then we should consider this. I don't think we should merge it unless we hit these though.

(Apologies with the delay for #1970, I was out of the office for a few weeks last month so I didn't get much done.)

@szotp
Copy link
Contributor Author

szotp commented Oct 7, 2019

Alright, I'm waiting for #1970 then, this PR can always be reopened.

@szotp szotp closed this Oct 7, 2019
@szotp
Copy link
Contributor Author

szotp commented Oct 7, 2019

I just had another idea: Flutter: Generate command that does flutter generate and then reanalyze. Would that pass?

@DanTup
Copy link
Member

DanTup commented Oct 7, 2019

I think a command to run generate makes sense (it should only be visible if you have a Flutter project open, and use the correct project root - similar to flutter packages get etc.).

Before adding an automatic reanalyze, I think we should try to figure out if it's an analysis server bug that it's required (it should pick up changes in files automatically, and incremental work is much faster than reanalyzing a large project).

I'm just going to do some digging with your repro from #1970.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants