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 7f63419006fd6e2ea79544967aa2cd78c2c91aa1..cd843de0c537f028f941ed1264678d64335c1267 100644 |
--- a/pkg/analysis_server/lib/src/server/driver.dart |
+++ b/pkg/analysis_server/lib/src/server/driver.dart |
@@ -18,6 +18,7 @@ import 'package:analyzer/file_system/physical_file_system.dart'; |
import 'package:analyzer/instrumentation/file_instrumentation.dart'; |
import 'package:analyzer/instrumentation/instrumentation.dart'; |
import 'package:analyzer/plugin/resolver_provider.dart'; |
+import 'package:analyzer/src/context/builder.dart'; |
import 'package:analyzer/src/dart/sdk/sdk.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/sdk.dart'; |
@@ -196,6 +197,12 @@ class Driver implements ServerStarter { |
static const String FILE_READ_MODE = "file-read-mode"; |
/** |
+ * The name of the flag used when analyzing the flutter repository. |
+ * See comments in source for `flutter analyze --watch`. |
+ */ |
+ static const FLUTTER_REPO = "flutter-repo"; |
+ |
+ /** |
* The name of the option used to print usage information. |
*/ |
static const String HELP_OPTION = "help"; |
@@ -310,6 +317,8 @@ class Driver implements ServerStarter { |
analysisServerOptions.enableVerboseFlutterCompletions = |
results[VERBOSE_FLUTTER_COMPLETIONS]; |
+ ContextBuilderOptions.flutterRepo = results[FLUTTER_REPO]; |
+ |
telemetry.Analytics analytics = telemetry.createAnalyticsInstance( |
'UA-26406144-29', 'analysis-server', |
disableForSession: results[SUPPRESS_ANALYTICS_FLAG]); |
@@ -485,6 +494,10 @@ class Driver implements ServerStarter { |
help: "enable sending instrumentation information to a server", |
defaultsTo: false, |
negatable: false); |
+ parser.addFlag(FLUTTER_REPO, |
+ help: 'used by "flutter analyze" to enable specific lints' |
+ ' when analyzing the flutter repository', |
+ hide: false); |
parser.addFlag(HELP_OPTION, |
help: "print this help message without starting a server", |
abbr: 'h', |