Index: pkg/analyzer/lib/src/generated/engine.dart |
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart |
index b27c42e927430d138f919ebf01c0b0d60f4ddfb9..2e1d9f051b1ad42b8e3188cea76989e95dbba4e8 100644 |
--- a/pkg/analyzer/lib/src/generated/engine.dart |
+++ b/pkg/analyzer/lib/src/generated/engine.dart |
@@ -1123,6 +1123,19 @@ abstract class AnalysisOptions { |
* Return `true` if strong mode analysis should be used. |
*/ |
bool get strongMode; |
+ |
+ /** |
+ * Return an integer encoding of the values of the options that need to be the |
+ * same across all of the contexts associated with partitions that are to be |
+ * shared by a single analysis context. |
+ */ |
+ int encodeCrossContextOptions(); |
+ |
+ /** |
+ * Set the values of the cross-context options to match those in the given set |
+ * of [options]. |
+ */ |
+ void setCrossContextOptionsFrom(AnalysisOptions options); |
} |
/** |
@@ -1135,6 +1148,14 @@ class AnalysisOptionsImpl implements AnalysisOptions { |
*/ |
static const int DEFAULT_CACHE_SIZE = 64; |
+ static const int ENABLE_ASSERT_FLAG = 0x01; |
+ static const int ENABLE_ASYNC_FLAG = 0x02; |
+ static const int ENABLE_GENERIC_METHODS_FLAG = 0x04; |
+ static const int ENABLE_STRICT_CALL_CHECKS_FLAG = 0x08; |
+ static const int ENABLE_STRONG_MODE_FLAG = 0x10; |
+ static const int ENABLE_STRONG_MODE_HINTS_FLAG = 0x20; |
+ static const int ENABLE_SUPER_MIXINS_FLAG = 0x40; |
+ |
/** |
* A predicate indicating whether analysis is to parse and analyze function |
* bodies. |
@@ -1308,6 +1329,29 @@ class AnalysisOptionsImpl implements AnalysisOptions { |
_analyzeFunctionBodiesPredicate = value; |
} |
+ @override |
+ int encodeCrossContextOptions() => |
+ (enableAssertMessage ? ENABLE_ASSERT_FLAG : 0) | |
+ (enableAsync ? ENABLE_ASYNC_FLAG : 0) | |
+ (enableGenericMethods ? ENABLE_GENERIC_METHODS_FLAG : 0) | |
+ (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) | |
+ (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) | |
+ (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0) | |
+ (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0); |
+ |
+ @override |
+ void setCrossContextOptionsFrom(AnalysisOptions options) { |
+ enableAssertMessage = options.enableAssertMessage; |
+ enableAsync = options.enableAsync; |
+ enableGenericMethods = options.enableGenericMethods; |
+ enableStrictCallChecks = options.enableStrictCallChecks; |
+ enableSuperMixins = options.enableSuperMixins; |
+ strongMode = options.strongMode; |
+ if (options is AnalysisOptionsImpl) { |
+ strongModeHints = options.strongModeHints; |
+ } |
+ } |
+ |
/** |
* Predicate used for [analyzeFunctionBodiesPredicate] when |
* [analyzeFunctionBodies] is set to `true`. |