Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 800723002: Allow completions to wait for analysis without requiring a busy wait loop. (Closed)

Created:
6 years ago by Paul Berry
Modified:
6 years ago
CC:
reviews_dartlang.org
Target Ref:
refs/remotes/git-svn
Visibility:
Public.

Description

Allow completions to wait for analysis without requiring a busy wait loop. Two new methods are added to the AnalysisContext which return Futures--the futures complete with the result of analysis once it's available, avoiding the need for a busy wait loop in the completion engine. The futures are guaranteed to complete eventually (provided that analysis reaches quiescence). If it is determined that the requested analysis will never become available (e.g. because analysis was requested for a file or file/library combination that is not subject to analysis), the future will be completed with an AnalysisNotScheduledError, so that the client isn't stalled forever waiting for analysis results. R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=42339

Patch Set 1 #

Total comments: 17
Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -39 lines) Patch
M pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart View 2 chunks +18 lines, -25 lines 0 comments Download
M pkg/analysis_server/test/completion_test.dart View 3 chunks +9 lines, -11 lines 0 comments Download
M pkg/analysis_server/test/services/completion/completion_computer_test.dart View 3 chunks +15 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/engine.dart View 12 chunks +222 lines, -1 line 17 comments Download
M pkg/analyzer/test/generated/engine_test.dart View 9 chunks +77 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
Paul Berry
6 years ago (2014-12-12 00:56:59 UTC) #2
scheglov
Just a comment. https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart File pkg/analyzer/lib/src/generated/engine.dart (right): https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart#newcode771 pkg/analyzer/lib/src/generated/engine.dart:771: LibraryElement library); It would be slightly ...
6 years ago (2014-12-12 03:41:56 UTC) #4
Brian Wilkerson
As you know, I don't like the addition of an asynchronous interface to the engine, ...
6 years ago (2014-12-12 15:13:12 UTC) #5
scheglov
https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart File pkg/analyzer/lib/src/generated/engine.dart (right): https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart#newcode771 pkg/analyzer/lib/src/generated/engine.dart:771: LibraryElement library); On 2014/12/12 15:13:12, Brian Wilkerson wrote: > ...
6 years ago (2014-12-12 15:25:09 UTC) #6
Brian Wilkerson
https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart File pkg/analyzer/lib/src/generated/engine.dart (right): https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart#newcode771 pkg/analyzer/lib/src/generated/engine.dart:771: LibraryElement library); > And implementation uses just Source anyway. ...
6 years ago (2014-12-12 15:31:42 UTC) #7
danrubel
https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart File pkg/analyzer/lib/src/generated/engine.dart (right): https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart#newcode770 pkg/analyzer/lib/src/generated/engine.dart:770: Future<CompilationUnit> getResolvedCompilationUnitFuture(Source source, How do I cancel waiting for ...
6 years ago (2014-12-12 16:06:15 UTC) #8
Paul Berry
https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart File pkg/analyzer/lib/src/generated/engine.dart (right): https://codereview.chromium.org/800723002/diff/1/pkg/analyzer/lib/src/generated/engine.dart#newcode770 pkg/analyzer/lib/src/generated/engine.dart:770: Future<CompilationUnit> getResolvedCompilationUnitFuture(Source source, On 2014/12/12 16:06:15, danrubel wrote: > ...
6 years ago (2014-12-12 17:36:39 UTC) #9
danrubel
lgtm
6 years ago (2014-12-12 18:22:27 UTC) #10
Paul Berry
6 years ago (2014-12-12 18:22:49 UTC) #11
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as 42339 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698