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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 956103002: Add instrumentation (issue 22572) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 0110d9805e1877ac6e3dfad23b5ab844b759c51f..a99cbebf283fbd1f90efff3f07513df32eeea9ba 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -249,8 +249,11 @@ class AnalysisServer {
searchEngine = _index != null ? createSearchEngine(_index) : null {
_performance = performanceDuringStartup;
operationQueue = new ServerOperationQueue();
- contextDirectoryManager =
- new ServerContextManager(this, resourceProvider, packageMapProvider);
+ contextDirectoryManager = new ServerContextManager(
+ this,
+ resourceProvider,
+ packageMapProvider,
+ instrumentationService);
contextDirectoryManager.defaultOptions.incremental = true;
contextDirectoryManager.defaultOptions.incrementalApi =
analysisServerOptions.enableIncrementalResolutionApi;
@@ -497,6 +500,32 @@ class AnalysisServer {
// }
/**
+ * Returns resolved [CompilationUnit]s of the Dart file with the given [path].
+ *
+ * May be empty, but not `null`.
+ */
+ List<CompilationUnit> getResolvedCompilationUnits(String path) {
+ List<CompilationUnit> units = <CompilationUnit>[];
+ // prepare AnalysisContext
+ AnalysisContext context = getAnalysisContext(path);
+ if (context == null) {
+ return units;
+ }
+ // add a unit for each unit/library combination
+ Source unitSource = getSource(path);
+ List<Source> librarySources = context.getLibrariesContaining(unitSource);
+ for (Source librarySource in librarySources) {
+ CompilationUnit unit =
+ context.resolveCompilationUnit2(unitSource, librarySource);
+ if (unit != null) {
+ units.add(unit);
+ }
+ }
+ // done
+ return units;
+ }
+
+ /**
* Returns the [CompilationUnit] of the Dart file with the given [path] that
* should be used to resend notifications for already resolved unit.
* Returns `null` if the file is not a part of any context, library has not
@@ -524,32 +553,6 @@ class AnalysisServer {
}
/**
- * Returns resolved [CompilationUnit]s of the Dart file with the given [path].
- *
- * May be empty, but not `null`.
- */
- List<CompilationUnit> getResolvedCompilationUnits(String path) {
- List<CompilationUnit> units = <CompilationUnit>[];
- // prepare AnalysisContext
- AnalysisContext context = getAnalysisContext(path);
- if (context == null) {
- return units;
- }
- // add a unit for each unit/library combination
- Source unitSource = getSource(path);
- List<Source> librarySources = context.getLibrariesContaining(unitSource);
- for (Source librarySource in librarySources) {
- CompilationUnit unit =
- context.resolveCompilationUnit2(unitSource, librarySource);
- if (unit != null) {
- units.add(unit);
- }
- }
- // done
- return units;
- }
-
- /**
* Return the [Source] of the Dart file with the given [path].
*/
Source getSource(String path) {
@@ -1180,8 +1183,8 @@ class ServerContextManager extends ContextManager {
StreamController<ContextsChangedEvent> _onContextsChangedController;
ServerContextManager(this.analysisServer, ResourceProvider resourceProvider,
- PackageMapProvider packageMapProvider)
- : super(resourceProvider, packageMapProvider) {
+ PackageMapProvider packageMapProvider, InstrumentationService service)
+ : super(resourceProvider, packageMapProvider, service) {
_onContextsChangedController =
new StreamController<ContextsChangedEvent>.broadcast();
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698