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

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

Issue 2415413003: Remove unused method and field from DartSdkManager (Closed)
Patch Set: Created 4 years, 2 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/test/analysis_abstract.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/server/driver.dart
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index dc971b89deb62a27a66d5acc4f124eca28335cdd..3095df81c368e09dd0d629ff5f181abf3d49673b 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -422,19 +422,10 @@ class Driver implements ServerStarter {
.path;
}
bool useSummaries = analysisServerOptions.fileReadMode == 'as-is';
- SdkCreator defaultSdkCreator = (AnalysisOptions options) {
- PhysicalResourceProvider resourceProvider =
- PhysicalResourceProvider.INSTANCE;
- FolderBasedDartSdk sdk = new FolderBasedDartSdk(
- resourceProvider, resourceProvider.getFolder(defaultSdkPath));
- sdk.analysisOptions = options;
- sdk.useSummary = useSummaries;
- return sdk;
- };
// TODO(brianwilkerson) It would be nice to avoid creating an SDK that
// cannot be re-used, but the SDK is needed to create a package map provider
// in the case where we need to run `pub` in order to get the package map.
- DartSdk defaultSdk = defaultSdkCreator(null);
+ DartSdk defaultSdk = _createDefaultSdk(defaultSdkPath, useSummaries);
//
// Initialize the instrumentation service.
//
@@ -458,7 +449,7 @@ class Driver implements ServerStarter {
//
socketServer = new SocketServer(
analysisServerOptions,
- new DartSdkManager(defaultSdkPath, useSummaries, defaultSdkCreator),
+ new DartSdkManager(defaultSdkPath, useSummaries),
defaultSdk,
service,
serverPlugin,
@@ -586,6 +577,15 @@ class Driver implements ServerStarter {
return parser;
}
+ DartSdk _createDefaultSdk(String defaultSdkPath, bool useSummaries) {
+ PhysicalResourceProvider resourceProvider =
+ PhysicalResourceProvider.INSTANCE;
+ FolderBasedDartSdk sdk = new FolderBasedDartSdk(
+ resourceProvider, resourceProvider.getFolder(defaultSdkPath));
+ sdk.useSummary = useSummaries;
+ return sdk;
+ }
+
/**
* Print information about how to use the server.
*/
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698