Skip to content

completion_metrics tool, with --overlay remove-token, throws InconsistentAnalysisException for flutter/gallery #48789

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

Closed
srawlins opened this issue Apr 11, 2022 · 8 comments
Assignees
Labels
devexp-completion Issues with the analysis server's code completion feature legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@srawlins
Copy link
Member

Cloning flutter/gallery, and then running flutter pub get, and then running the completion_metrics tool, throws an error:

$ $HOME/code/flutter/bin/dart pkg/analysis_server/tool/code_completion/completion_metrics.dart /Users/srawlins/code/flutter-gallery --overlay remove-token
Analyzing root: "/Users/srawlins/code/flutter-gallery"
Unhandled exception:
InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

#0      AnalysisSessionImpl._checkConsistency (package:analyzer/src/dart/analysis/session.dart:133:7)
#1      AnalysisSessionImpl.getResolvedUnit (package:analyzer/src/dart/analysis/session.dart:119:5)
#2      CompletionMetricsComputer._computeInContext (file:///Users/srawlins/code/dart-sdk/sdk/pkg/analysis_server/tool/code_completion/completion_metrics.dart:1409:16)
<asynchronous suspension>
#3      CompletionMetricsComputer.computeMetrics (file:///Users/srawlins/code/dart-sdk/sdk/pkg/analysis_server/tool/code_completion/completion_metrics.dart:737:7)
<asynchronous suspension>
#4      main (file:///Users/srawlins/code/dart-sdk/sdk/pkg/analysis_server/tool/code_completion/completion_metrics.dart:129:3)
<asynchronous suspension>

It seems to be doing better if I do not pass --overlay remove-token.

@srawlins srawlins added legacy-area-analyzer Use area-devexp instead. devexp-completion Issues with the analysis server's code completion feature P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Apr 11, 2022
@srawlins
Copy link
Member Author

CC @bwilkerson in case you're interested

@bwilkerson
Copy link
Member

I'm definitely interested, but @scheglov probably has more context for solving the underlying issue.

@scheglov scheglov self-assigned this Apr 14, 2022
@scheglov
Copy link
Contributor

This https://dart-review.googlesource.com/c/sdk/+/241208 seems to fix the exception, now the tool works... and works... and still works.

@srawlins
Copy link
Member Author

Haha, it took 90 minutes to run over flutter/gallery.

copybara-service bot pushed a commit that referenced this issue Apr 14, 2022
Bug: #48789
Change-Id: Ibb1ae34cdaa447385d9b2cd0f3282eb178b1dbf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241208
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov
Copy link
Contributor

If you are curious, it still runs. Which is concerning, but it uses CPU, so maybe not stuck?
image

@scheglov
Copy link
Contributor

I think the issue is fixed, but I still was not able to wait until the process is done.

@srawlins
Copy link
Member Author

I'm adding a progress bar here: https://dart-review.googlesource.com/c/sdk/+/241623

@srawlins
Copy link
Member Author

It seems to get waaaaay hung up on lib/codeviewer/code_segments.dart, a 47000 line file. Many many statements, not too many class members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-completion Issues with the analysis server's code completion feature legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants