| 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 e06709a25a3380fae53f027fed336d76ee6374b4..c513eece76052af5f1e01ef7f2c4d6fcbeaf0f9d 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -21,6 +21,7 @@ import 'sdk.dart' show DartSdk;
|
| import 'element.dart';
|
| import 'resolver.dart';
|
| import 'html.dart' as ht;
|
| +import 'package:analyzer/src/generated/constant.dart';
|
|
|
| /**
|
| * Instances of the class `AnalysisCache` implement an LRU cache of information related to
|
| @@ -239,9 +240,11 @@ abstract class AnalysisContext {
|
|
|
| /**
|
| * Return the documentation comment for the given element as it appears in the original source
|
| - * (complete with the beginning and ending delimiters), or `null` if the element does not
|
| - * have a documentation comment associated with it. This can be a long-running operation if the
|
| - * information needed to access the comment is not cached.
|
| + * (complete with the beginning and ending delimiters) for block documentation comments, or lines
|
| + * starting with `"///"` and separated with `"\n"` characters for end-of-line
|
| + * documentation comments, or `null` if the element does not have a documentation comment
|
| + * associated with it. This can be a long-running operation if the information needed to access
|
| + * the comment is not cached.
|
| *
|
| * <b>Note:</b> This method cannot be used in an async environment.
|
| *
|
| @@ -399,6 +402,13 @@ abstract class AnalysisContext {
|
| TimestampedData<String> getContents(Source source);
|
|
|
| /**
|
| + * Return the set of declared variables used when computing constant values.
|
| + *
|
| + * @return the set of declared variables used when computing constant values
|
| + */
|
| + DeclaredVariables get declaredVariables;
|
| +
|
| + /**
|
| * Return the element referenced by the given location, or `null` if the element is not
|
| * immediately available or if there is no element with the given location. The latter condition
|
| * can occur, for example, if the location describes an element from a different context or if the
|
| @@ -829,6 +839,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| SourceFactory _sourceFactory;
|
|
|
| /**
|
| + * The set of declared variables used when computing constant values.
|
| + */
|
| + DeclaredVariables _declaredVariables = new DeclaredVariables();
|
| +
|
| + /**
|
| * A source representing the core library.
|
| */
|
| Source _coreLibrarySource;
|
| @@ -1033,7 +1048,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| List<Token> tokens = comment.tokens;
|
| for (int i = 0; i < tokens.length; i++) {
|
| if (i > 0) {
|
| - builder.append('\n');
|
| + builder.append("\n");
|
| }
|
| builder.append(tokens[i].lexeme);
|
| }
|
| @@ -1233,6 +1248,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| }
|
|
|
| @override
|
| + DeclaredVariables get declaredVariables => _declaredVariables;
|
| +
|
| + @override
|
| Element getElement(ElementLocation location) {
|
| // TODO(brianwilkerson) This should not be a "get" method.
|
| try {
|
| @@ -4985,12 +5003,8 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| if (sourceEntry == null) {
|
| sourceEntry = _createSourceEntry(source, true);
|
| } else {
|
| - SourceEntryImpl sourceCopy = sourceEntry.writableCopy;
|
| - int newTime = getModificationStamp(source);
|
| - sourceCopy.modificationTime = newTime;
|
| - sourceCopy.explicitlyAdded = true;
|
| - // TODO(brianwilkerson) Understand why we're not invalidating the cached data.
|
| - _cache.put(source, sourceCopy);
|
| + _sourceChanged(source);
|
| + sourceEntry = _cache.get(source);
|
| }
|
| if (sourceEntry is HtmlEntry) {
|
| _workManager.add(source, SourcePriority.HTML);
|
| @@ -5027,7 +5041,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
| _computeAllLibrariesDependingOn(containingLibrary, librariesToInvalidate);
|
| }
|
| for (Source library in librariesToInvalidate) {
|
| - // for (Source library : containingLibraries) {
|
| _invalidateLibraryResolution(library);
|
| }
|
| _removeFromParts(source, _cache.get(source) as DartEntry);
|
| @@ -11752,6 +11765,9 @@ class InstrumentedAnalysisContextImpl implements InternalAnalysisContext {
|
| TimestampedData<String> getContents(Source source) => _basis.getContents(source);
|
|
|
| @override
|
| + DeclaredVariables get declaredVariables => _basis.declaredVariables;
|
| +
|
| + @override
|
| Element getElement(ElementLocation location) {
|
| InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-getElement");
|
| _checkThread(instrumentation);
|
|
|