Skip to content

Commit e758dff

Browse files
DanTupCommit Queue
authored and
Commit Queue
committed
[analysis_server] Add missing bool completions for strict language options in analysis_options
Fixes part of #59827, but not the main issue. Change-Id: I7f9d6cfd5163a1bf6c72f9eea4bb71872d3dfa15 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409140 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent 334152a commit e758dff

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

pkg/analysis_server/lib/src/services/completion/yaml/analysis_options_generator.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class AnalysisOptionsGenerator extends YamlCompletionGenerator {
2626
AnalysisOptionsFile.errors: _ErrorProducer(),
2727
AnalysisOptionsFile.exclude: EmptyProducer(),
2828
AnalysisOptionsFile.language: MapProducer({
29-
AnalysisOptionsFile.strictCasts: EmptyProducer(),
30-
AnalysisOptionsFile.strictInference: EmptyProducer(),
31-
AnalysisOptionsFile.strictRawTypes: EmptyProducer(),
29+
AnalysisOptionsFile.strictCasts: BooleanProducer(),
30+
AnalysisOptionsFile.strictInference: BooleanProducer(),
31+
AnalysisOptionsFile.strictRawTypes: BooleanProducer(),
3232
}),
3333
AnalysisOptionsFile.optionalChecks: MapProducer({
3434
AnalysisOptionsFile.chromeOsManifestChecks: EmptyProducer(),

pkg/analysis_server/test/src/services/completion/yaml/analysis_options_generator_test.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,36 @@ analyzer:
9898
assertSuggestion('error');
9999
}
100100

101+
void test_analyzer_language_strictCasts() {
102+
getCompletions('''
103+
analyzer:
104+
language:
105+
strict-casts: ^
106+
''');
107+
assertSuggestion('false');
108+
assertSuggestion('true');
109+
}
110+
111+
void test_analyzer_language_strictInference() {
112+
getCompletions('''
113+
analyzer:
114+
language:
115+
strict-inference: ^
116+
''');
117+
assertSuggestion('false');
118+
assertSuggestion('true');
119+
}
120+
121+
void test_analyzer_language_strictRawTypes() {
122+
getCompletions('''
123+
analyzer:
124+
language:
125+
strict-raw-types: ^
126+
''');
127+
assertSuggestion('false');
128+
assertSuggestion('true');
129+
}
130+
101131
void test_codeStyle() {
102132
getCompletions('''
103133
code-style:

0 commit comments

Comments
 (0)