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

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 2552023002: Send 'analysis.flushResults' on file removal. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library context.directory.manager; 5 library context.directory.manager;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:core'; 10 import 'dart:core';
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 */ 339 */
340 AnalysisDriver addAnalysisDriver(Folder folder, AnalysisOptions options); 340 AnalysisDriver addAnalysisDriver(Folder folder, AnalysisOptions options);
341 341
342 /** 342 /**
343 * Create and return a new analysis context rooted at the given [folder], with 343 * Create and return a new analysis context rooted at the given [folder], with
344 * the given analysis [options]. 344 * the given analysis [options].
345 */ 345 */
346 AnalysisContext addContext(Folder folder, AnalysisOptions options); 346 AnalysisContext addContext(Folder folder, AnalysisOptions options);
347 347
348 /** 348 /**
349 * The given [file] was removed from the folder analyzed in the [driver].
350 */
351 void applyFileRemoved(AnalysisDriver driver, String file);
352
353 /**
349 * Called when the set of files associated with a context have changed (or 354 * Called when the set of files associated with a context have changed (or
350 * some of those files have been modified). [changeSet] is the set of 355 * some of those files have been modified). [changeSet] is the set of
351 * changes that need to be applied to the context. 356 * changes that need to be applied to the context.
352 */ 357 */
353 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet); 358 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet);
354 359
355 /** 360 /**
356 * Signals that the context manager has started to compute a package map (if 361 * Signals that the context manager has started to compute a package map (if
357 * [computing] is `true`) or has finished (if [computing] is `false`). 362 * [computing] is `true`) or has finished (if [computing] is `false`).
358 */ 363 */
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 absolutePathContext.append(directoryPath, PUBSPEC_NAME)) 1477 absolutePathContext.append(directoryPath, PUBSPEC_NAME))
1473 .exists) { 1478 .exists) {
1474 _mergeContext(info); 1479 _mergeContext(info);
1475 return; 1480 return;
1476 } 1481 }
1477 } 1482 }
1478 } 1483 }
1479 } 1484 }
1480 1485
1481 if (enableNewAnalysisDriver) { 1486 if (enableNewAnalysisDriver) {
1482 info.analysisDriver.removeFile(path); 1487 callbacks.applyFileRemoved(info.analysisDriver, path);
1483 } else { 1488 } else {
1484 List<Source> sources = info.context.getSourcesWithFullName(path); 1489 List<Source> sources = info.context.getSourcesWithFullName(path);
1485 if (!sources.isEmpty) { 1490 if (!sources.isEmpty) {
1486 ChangeSet changeSet = new ChangeSet(); 1491 ChangeSet changeSet = new ChangeSet();
1487 sources.forEach((Source source) { 1492 sources.forEach((Source source) {
1488 changeSet.removedSource(source); 1493 changeSet.removedSource(source);
1489 }); 1494 });
1490 callbacks.applyChangesToContext(info.folder, changeSet); 1495 callbacks.applyChangesToContext(info.folder, changeSet);
1491 info.sources.remove(path); 1496 info.sources.remove(path);
1492 } 1497 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 } 1931 }
1927 return _embedderLocator; 1932 return _embedderLocator;
1928 } 1933 }
1929 1934
1930 @override 1935 @override
1931 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { 1936 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) {
1932 return _sdkExtensionFinder ??= 1937 return _sdkExtensionFinder ??=
1933 new SdkExtensionFinder(buildPackageMap(resourceProvider)); 1938 new SdkExtensionFinder(buildPackageMap(resourceProvider));
1934 } 1939 }
1935 } 1940 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698