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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java

Issue 717423003: add new analysis server preferences to experimental page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 1 month 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
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java
index 3a6f1f5bcea2887d5ffd5bd5aa8ecc1a5e5e9123..f97f912449b822da52faae5b9cdaef3d57b82c5b 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java
@@ -85,7 +85,12 @@ public class DartCoreDebug {
|| DartCore.getPlugin().getPrefs().getBoolean(ENABLE_ANALYSIS_SERVER_PREF, false);
public static final boolean ANALYSIS_SERVER_DEBUG = isOptionTrue("experimental/analysisServer/debug");
- public static final String ANALYSIS_SERVER_HTTP_PORT = getOptionValue("experimental/analysisServer/http_port");
+
+ public static final String ANALYSIS_SERVER_HTTP_PORT_PREF = "analysisServerHttpPort";
+ public static final String ANALYSIS_SERVER_HTTP_PORT = getOptionOrPrefValue(
+ "experimental/analysisServer/http_port",
+ ANALYSIS_SERVER_HTTP_PORT_PREF);
+
public static final String ANALYSIS_SERVER_LOG_FILE = getOptionValue("experimental/analysisServer/logFile");
public static final boolean ANALYSIS_SERVER_PROFILE = isOptionTrue("experimental/analysisServer/profile");
public static final boolean NO_PUB_PACKAGES = isOptionTrue("experimental/noPubPackages");
@@ -111,6 +116,9 @@ public class DartCoreDebug {
// Cause AnalysisEngine to throw exceptions if server is enabled
AnalysisEngine.setDisableEngine(ENABLE_ANALYSIS_SERVER);
+ instrumentation.metric("ENABLE_ANALYSIS_SERVER", ENABLE_ANALYSIS_SERVER);
+ instrumentation.metric("ANALYSIS_SERVER_HTTP_PORT", ANALYSIS_SERVER_HTTP_PORT);
+
instrumentation.metric("DEBUG_INDEX_CONTRIBUTOR", DEBUG_INDEX_CONTRIBUTOR);
instrumentation.metric("METRICS", METRICS);
instrumentation.metric("WARMUP", WARMUP);
@@ -145,6 +153,17 @@ public class DartCoreDebug {
}
/**
+ * Returns a value of the option or the preference.
+ */
+ private static String getOptionOrPrefValue(String optionSuffix, String prefKey) {
+ String value = getOptionValue(optionSuffix);
+ if (value == null || value.length() == 0) {
+ value = DartCore.getPlugin().getPrefs().get(prefKey, "");
+ }
+ return value;
+ }
+
+ /**
* Returns a value of the option, {@code null} if not set.
*/
private static String getOptionValue(String optionSuffix) {
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/preferences/DartBasePreferencePage.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698