Fix analyzer plugin crash, highlight import strings

This commit is contained in:
Simon Binder 2020-01-08 12:17:43 +01:00
parent cefa290d7e
commit a0684364c5
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
2 changed files with 5 additions and 3 deletions

View File

@ -74,7 +74,7 @@ class MoorOptions {
this.useDataClassNameForCompanions = false,
this.useColumnNameAsJsonKeyWhenDefinedInMoorFile = false,
this.generateConnectConstructor = false,
this.useExperimentalInference,
this.useExperimentalInference = false,
this.modules = const []});
factory MoorOptions.fromJson(Map<String, dynamic> json) =>

View File

@ -37,6 +37,9 @@ class MoorHighlightContributor implements HighlightsContributor {
} else if (token is VariableToken) {
collector.addRegion(
start, length, HighlightRegionType.PARAMETER_REFERENCE);
} else if (token is StringLiteralToken) {
collector.addRegion(
start, length, HighlightRegionType.LITERAL_STRING);
}
}
}
@ -123,10 +126,9 @@ class _HighlightingVisitor extends RecursiveVisitor<void, void> {
_contribute(e, HighlightRegionType.BUILT_IN);
} else if (e is NumericLiteral) {
_contribute(e, HighlightRegionType.LITERAL_INTEGER);
} else if (e is StringLiteral) {
_contribute(e, HighlightRegionType.LITERAL_STRING);
} else if (e is BooleanLiteral) {
_contribute(e, HighlightRegionType.LITERAL_BOOLEAN);
}
// string literals are reported for each string token
}
}