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

Unified Diff: pkg/analysis_server/lib/src/plugin/plugin_manager.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/analysis_server/lib/src/analysis_server.dart ('k') | 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/plugin/plugin_manager.dart
diff --git a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
index ea49b8aeeecff94a2258e3793e2abe864ac133d0..01e26286effe3480b6c17c5250826d95a0e991a9 100644
--- a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
+++ b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
@@ -186,12 +186,12 @@ abstract class PluginInfo {
* Start a new isolate that is running the plugin. Return the state object
* used to interact with the plugin, or `null` if the plugin could not be run.
*/
- Future<PluginSession> start(String byteStorePath) async {
+ Future<PluginSession> start(String byteStorePath, String sdkPath) async {
if (currentSession != null) {
throw new StateError('Cannot start a plugin that is already running.');
}
currentSession = new PluginSession(this);
- bool isRunning = await currentSession.start(byteStorePath);
+ bool isRunning = await currentSession.start(byteStorePath, sdkPath);
if (!isRunning) {
currentSession = null;
}
@@ -246,6 +246,11 @@ class PluginManager {
final String byteStorePath;
/**
+ * The absolute path of the directory containing the SDK.
+ */
+ final String sdkPath;
+
+ /**
* The object used to manage the receiving and sending of notifications.
*/
final NotificationManager notificationManager;
@@ -285,7 +290,7 @@ class PluginManager {
* Initialize a newly created plugin manager. The notifications from the
* running plugins will be handled by the given [notificationManager].
*/
- PluginManager(this.resourceProvider, this.byteStorePath,
+ PluginManager(this.resourceProvider, this.byteStorePath, this.sdkPath,
this.notificationManager, this.instrumentationService);
/**
@@ -306,7 +311,7 @@ class PluginManager {
notificationManager, instrumentationService);
_pluginMap[path] = plugin;
if (pluginPaths[0] != null) {
- PluginSession session = await plugin.start(byteStorePath);
+ PluginSession session = await plugin.start(byteStorePath, sdkPath);
session?.onDone?.then((_) {
_pluginMap.remove(path);
});
@@ -711,7 +716,7 @@ class PluginSession {
* the given [byteStorePath]. Return `true` if the plugin is compatible and
* running.
*/
- Future<bool> start(String byteStorePath) async {
+ Future<bool> start(String byteStorePath, String sdkPath) async {
if (channel != null) {
throw new StateError('Cannot start a plugin that is already running.');
}
@@ -729,8 +734,8 @@ class PluginSession {
// handleOnDone, which will cause `channel` to be set to `null`.
return false;
}
- Response response = await sendRequest(
- new PluginVersionCheckParams(byteStorePath ?? '', '1.0.0-alpha.0'));
+ Response response = await sendRequest(new PluginVersionCheckParams(
+ byteStorePath ?? '', sdkPath, '1.0.0-alpha.0'));
PluginVersionCheckResult result =
new PluginVersionCheckResult.fromResponse(response);
isCompatible = result.isCompatible;
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698