mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
Reland "[analysis_server] Use fixDataYamlFolder constant instead of string literals"
This is a reland of commit ccb02fa8fc
Original change's description:
> [analysis_server] Use fixDataYamlFolder constant instead of string literals
>
> Follow-up from https://dart-review.googlesource.com/c/sdk/+/296801.
>
> Change-Id: I72ea8a42ec64c4bd6c6cee021a1464167ec368e6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296862
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I202392de3444556dc2baa9ed9e1b82c3a1ede4aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
8d97964e6e
commit
c4d2d2d7c2
|
@ -458,7 +458,7 @@ class ContextManagerImpl implements ContextManager {
|
|||
// packageName/lib/fix_data.yaml
|
||||
packageName = pathSegments[pathSegments.length - 3];
|
||||
} else {
|
||||
var fixDataIndex = pathSegments.indexOf('fix_data');
|
||||
var fixDataIndex = pathSegments.indexOf(file_paths.fixDataYamlFolder);
|
||||
if (fixDataIndex >= 2) {
|
||||
// packageName/lib/fix_data/foo/bar/fix.yaml
|
||||
packageName = pathSegments[fixDataIndex - 2];
|
||||
|
@ -574,7 +574,7 @@ class ContextManagerImpl implements ContextManager {
|
|||
|
||||
var fixDataFolder = rootFolder
|
||||
.getChildAssumingFolder('lib')
|
||||
.getChildAssumingFolder('fix_data');
|
||||
.getChildAssumingFolder(file_paths.fixDataYamlFolder);
|
||||
if (fixDataFolder.exists) {
|
||||
_analyzeFixDataFolder(driver, fixDataFolder, packageName);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ bool isDart(p.Context pathContext, String path) {
|
|||
/// Such files specify data-driven fixes.
|
||||
bool isFixDataYaml(p.Context pathContext, String path) {
|
||||
return pathContext.basename(path) == fixDataYaml ||
|
||||
(pathContext.split(path).contains('fix_data') &&
|
||||
(pathContext.split(path).contains(fixDataYamlFolder) &&
|
||||
pathContext.extension(path) == '.yaml');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue