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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 758383003: Incremental resolution of updated DartDoc comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index bc8654af222cc3cf98577b3028221355e97b59f2..c4eaf02ef2c5ea92b2a000e420c52e1bdf9d8611 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -11077,6 +11077,16 @@ class ResolverVisitor extends ScopedVisitor {
TypePromotionManager _promoteManager = new TypePromotionManager();
/**
+ * A comment before a function should be resolved in the context of the
+ * function. But when we incrementally resolve a comment, we don't want to
+ * resolve the whole function.
+ *
+ * So, this flag is set to `true`, when just context of the function should
+ * be built and the comment resolved.
+ */
+ bool resolveOnlyCommentInFunctionBody = false;
+
+ /**
* Initialize a newly created visitor to resolve the nodes in a compilation unit.
*
* @param library the library containing the compilation unit being resolved
@@ -11506,6 +11516,13 @@ class ResolverVisitor extends ScopedVisitor {
return null;
}
+ /**
+ * Prepares this [ResolverVisitor] to using it for incremental resolution.
+ */
+ void initForIncrementalResolution() {
+ _overrideManager.enterScope();
+ }
+
@override
Object visitCompilationUnit(CompilationUnit node) {
//
@@ -11659,6 +11676,9 @@ class ResolverVisitor extends ScopedVisitor {
@override
Object visitEmptyFunctionBody(EmptyFunctionBody node) {
safelyVisit(_commentBeforeFunction);
+ if (resolveOnlyCommentInFunctionBody) {
+ return null;
+ }
return super.visitEmptyFunctionBody(node);
}
@@ -11680,6 +11700,9 @@ class ResolverVisitor extends ScopedVisitor {
@override
Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
safelyVisit(_commentBeforeFunction);
+ if (resolveOnlyCommentInFunctionBody) {
+ return null;
+ }
_overrideManager.enterScope();
try {
super.visitExpressionFunctionBody(node);

Powered by Google App Engine
This is Rietveld 408576698