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

Unified Diff: pkg/analyzer_plugin/lib/plugin/plugin.dart

Issue 2885993004: Pass the sdk path to plugins (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol_constants.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/lib/plugin/plugin.dart
diff --git a/pkg/analyzer_plugin/lib/plugin/plugin.dart b/pkg/analyzer_plugin/lib/plugin/plugin.dart
index a10afbb86be648b64fc1ba1bf75960c0e83ba082..4bbe1fae1f67c340d5fc5e6059b302a5a7c1cf52 100644
--- a/pkg/analyzer_plugin/lib/plugin/plugin.dart
+++ b/pkg/analyzer_plugin/lib/plugin/plugin.dart
@@ -9,6 +9,7 @@ import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/src/dart/analysis/driver.dart'
show AnalysisDriverGeneric, AnalysisDriverScheduler;
import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer_plugin/channel/channel.dart';
import 'package:analyzer_plugin/protocol/protocol.dart';
@@ -79,6 +80,11 @@ abstract class ServerPlugin {
ByteStore _byteStore;
/**
+ * The SDK manager used to manage SDKs.
+ */
+ DartSdkManager _sdkManager;
+
+ /**
* The file content overlay used by any analysis drivers that are created.
*/
final FileContentOverlay fileContentOverlay = new FileContentOverlay();
@@ -125,6 +131,11 @@ abstract class ServerPlugin {
String get name;
/**
+ * Return the SDK manager used to manage SDKs.
+ */
+ DartSdkManager get sdkManager => _sdkManager;
+
+ /**
* Return the version number of this plugin, encoded as a string.
*/
String get version;
@@ -398,10 +409,12 @@ abstract class ServerPlugin {
Future<PluginVersionCheckResult> handlePluginVersionCheck(
PluginVersionCheckParams parameters) async {
String byteStorePath = parameters.byteStorePath;
+ String sdkPath = parameters.sdkPath;
String versionString = parameters.version;
Version serverVersion = new Version.parse(versionString);
_byteStore =
new MemoryCachingByteStore(new FileByteStore(byteStorePath), 64 * M);
+ _sdkManager = new DartSdkManager(sdkPath, true);
return new PluginVersionCheckResult(
isCompatibleWith(serverVersion), name, version, fileGlobsToAnalyze,
contactInfo: contactInfo);
« no previous file with comments | « pkg/analyzer_plugin/doc/api.html ('k') | pkg/analyzer_plugin/lib/protocol/protocol_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698