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

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

Issue 2266763002: Remove changes that were accidentally entangled with an earlier CL (TBD) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 import 'dart:io' as io; 10 import 'dart:io' as io;
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 /** 1589 /**
1590 * The [ResourceProvider] by which paths are converted into [Resource]s. 1590 * The [ResourceProvider] by which paths are converted into [Resource]s.
1591 */ 1591 */
1592 final ResourceProvider resourceProvider; 1592 final ResourceProvider resourceProvider;
1593 1593
1594 ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider); 1594 ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider);
1595 1595
1596 @override 1596 @override
1597 AnalysisContext addContext( 1597 AnalysisContext addContext(
1598 Folder folder, AnalysisOptions options, FolderDisposition disposition) { 1598 Folder folder, AnalysisOptions options, FolderDisposition disposition) {
1599 String defaultPackageFilePath = null; 1599 InternalAnalysisContext context =
1600 String defaultPackagesDirectoryPath = null; 1600 AnalysisEngine.instance.createAnalysisContext();
1601 String path = (analysisServer.contextManager as ContextManagerImpl) 1601 context.contentCache = analysisServer.overlayState;
1602 .normalizedPackageRoots[folder.toString()]; 1602 analysisServer.folderMap[folder] = context;
1603 if (path != null) { 1603 context.fileResolverProvider = analysisServer.fileResolverProvider;
1604 Resource resource = resourceProvider.getResource(path); 1604 context.sourceFactory =
1605 if (resource.exists) { 1605 _createSourceFactory(context, options, disposition, folder);
1606 if (resource is File) { 1606 context.analysisOptions = options;
1607 defaultPackageFilePath = path;
1608 } else {
1609 defaultPackagesDirectoryPath = path;
1610 }
1611 }
1612 }
1613 StringBuffer buffer = new StringBuffer();
1614 buffer.writeln('normalizedPackageRoots:');
1615 (analysisServer.contextManager as ContextManagerImpl)
1616 .normalizedPackageRoots
1617 .forEach((String key, String value) {
1618 buffer.writeln(' "$key" --> "$value"');
1619 });
1620 buffer.writeln('folder = $folder');
1621 buffer.writeln('defaultPackageFilePath = $defaultPackageFilePath');
1622 buffer.writeln(
1623 'defaultPackagesDirectoryPath = $defaultPackagesDirectoryPath');
1624 buffer.writeln('disposition.packageRoot = ${disposition.packageRoot}');
1625 new io.File('/Users/brianwilkerson/temp/debug.txt')
1626 .writeAsStringSync(buffer.toString());
1627
1628 ContextBuilder builder = new ContextBuilder(resourceProvider,
1629 analysisServer.sdkManager, analysisServer.overlayState);
1630 builder.defaultOptions = options;
1631 builder.fileResolverProvider = analysisServer.fileResolverProvider;
1632 builder.defaultPackageFilePath = defaultPackageFilePath;
1633 builder.defaultPackagesDirectoryPath = defaultPackagesDirectoryPath;
1634 AnalysisContext context = builder.buildContext(folder.path);
1635
1636 // InternalAnalysisContext context =
1637 // AnalysisEngine.instance.createAnalysisContext();
1638 // context.contentCache = analysisServer.overlayState;
1639 // context.fileResolverProvider = analysisServer.fileResolverProvider;
1640 // context.sourceFactory =
1641 // _createSourceFactory(context, options, disposition, folder);
1642 // context.analysisOptions = options;
1643
1644 // TODO(brianwilkerson) Move bundle discovery into ContextBuilder
1645 if (analysisServer.options.enablePubSummaryManager) { 1607 if (analysisServer.options.enablePubSummaryManager) {
1646 List<LinkedPubPackage> linkedBundles = 1608 List<LinkedPubPackage> linkedBundles =
1647 analysisServer.pubSummaryManager.getLinkedBundles(context); 1609 analysisServer.pubSummaryManager.getLinkedBundles(context);
1648 if (linkedBundles.isNotEmpty) { 1610 if (linkedBundles.isNotEmpty) {
1649 SummaryDataStore store = new SummaryDataStore([]); 1611 SummaryDataStore store = new SummaryDataStore([]);
1650 for (LinkedPubPackage package in linkedBundles) { 1612 for (LinkedPubPackage package in linkedBundles) {
1651 store.addBundle(null, package.unlinked); 1613 store.addBundle(null, package.unlinked);
1652 store.addBundle(null, package.linked); 1614 store.addBundle(null, package.linked);
1653 } 1615 }
1654 (context as InternalAnalysisContext).resultProvider = 1616 context.resultProvider =
1655 new InputPackagesResultProvider(context, store); 1617 new InputPackagesResultProvider(context, store);
1656 } 1618 }
1657 } 1619 }
1658 1620
1659 analysisServer.folderMap[folder] = context;
1660 analysisServer._onContextsChangedController 1621 analysisServer._onContextsChangedController
1661 .add(new ContextsChangedEvent(added: [context])); 1622 .add(new ContextsChangedEvent(added: [context]));
1662 analysisServer.schedulePerformAnalysisOperation(context); 1623 analysisServer.schedulePerformAnalysisOperation(context);
1663 1624
1664 return context; 1625 return context;
1665 } 1626 }
1666 1627
1667 @override 1628 @override
1668 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { 1629 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
1669 AnalysisContext context = analysisServer.folderMap[contextFolder]; 1630 AnalysisContext context = analysisServer.folderMap[contextFolder];
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 /** 1815 /**
1855 * The [PerformanceTag] for time spent in server request handlers. 1816 * The [PerformanceTag] for time spent in server request handlers.
1856 */ 1817 */
1857 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1818 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1858 1819
1859 /** 1820 /**
1860 * The [PerformanceTag] for time spent in split store microtasks. 1821 * The [PerformanceTag] for time spent in split store microtasks.
1861 */ 1822 */
1862 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1823 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1863 } 1824 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698