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

Side by Side Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 2610063004: Add ContentCache.getExists() and use it in AnalysisContextImpl.exists(). (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.source; 5 library analyzer.src.generated.source;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 /** 59 /**
60 * Return the contents of the given [source], or `null` if this cache does not 60 * Return the contents of the given [source], or `null` if this cache does not
61 * override the contents of the source. 61 * override the contents of the source.
62 * 62 *
63 * <b>Note:</b> This method is not intended to be used except by 63 * <b>Note:</b> This method is not intended to be used except by
64 * [AnalysisContext.getContents]. 64 * [AnalysisContext.getContents].
65 */ 65 */
66 String getContents(Source source) => _contentMap[source.fullName]; 66 String getContents(Source source) => _contentMap[source.fullName];
67 67
68 /** 68 /**
69 * Return `true` if the given [source] exists, `false` if it does not exist,
70 * or `null` if this cache does not override existence of the source.
Paul Berry 2017/01/04 18:28:57 It looks like you are trying to plan ahead to a po
scheglov 2017/01/04 20:07:27 I'm trying to extend ContentCache to fully control
71 *
72 * <b>Note:</b> This method is not intended to be used except by
73 * [AnalysisContext.exists].
74 */
75 bool getExists(Source source) {
76 return _contentMap.containsKey(source.fullName) ? true : null;
Brian Wilkerson 2017/01/04 18:05:10 Did you intend to return `null` rather than `false
77 }
78
79 /**
69 * Return the modification stamp of the given [source], or `null` if this 80 * Return the modification stamp of the given [source], or `null` if this
70 * cache does not override the contents of the source. 81 * cache does not override the contents of the source.
71 * 82 *
72 * <b>Note:</b> This method is not intended to be used except by 83 * <b>Note:</b> This method is not intended to be used except by
73 * [AnalysisContext.getModificationStamp]. 84 * [AnalysisContext.getModificationStamp].
74 */ 85 */
75 int getModificationStamp(Source source) => _stampMap[source.fullName]; 86 int getModificationStamp(Source source) => _stampMap[source.fullName];
76 87
77 /** 88 /**
78 * Set the contents of the given [source] to the given [contents]. This has 89 * Set the contents of the given [source] to the given [contents]. This has
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 Source resolveAbsolute(Uri uri, [Uri actualUri]); 753 Source resolveAbsolute(Uri uri, [Uri actualUri]);
743 754
744 /** 755 /**
745 * Return an absolute URI that represents the given [source], or `null` if a 756 * Return an absolute URI that represents the given [source], or `null` if a
746 * valid URI cannot be computed. 757 * valid URI cannot be computed.
747 * 758 *
748 * The computation should be based solely on [source.fullName]. 759 * The computation should be based solely on [source.fullName].
749 */ 760 */
750 Uri restoreAbsolute(Source source) => null; 761 Uri restoreAbsolute(Source source) => null;
751 } 762 }
OLDNEW
« pkg/analyzer/lib/src/context/context.dart ('K') | « pkg/analyzer/lib/src/context/context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698