@@ -153,7 +153,7 @@ ArgParser createArgParser() {
153153 )
154154 ..addFlag ('help' , abbr: 'h' , help: 'Print this help message.' )
155155 ..addOption (
156- CompletionMetricsOptions .OVERLAY ,
156+ CompletionMetricsOptions .overlayOption ,
157157 allowed: [
158158 OverlayMode .none.flag,
159159 OverlayMode .removeRestOfFile.flag,
@@ -167,38 +167,38 @@ ArgParser createArgParser() {
167167 'complete at the start of the token without modifying the file.' ,
168168 )
169169 ..addOption (
170- CompletionMetricsOptions .PREFIX_LENGTH ,
170+ CompletionMetricsOptions .prefixLengthOption ,
171171 defaultsTo: '0' ,
172172 help:
173173 'The number of characters to include in the prefix. Each '
174174 'completion will be requested this many characters in from the '
175175 'start of the token being completed.' ,
176176 )
177177 ..addFlag (
178- CompletionMetricsQualityOptions .PRINT_MISSED_COMPLETION_DETAILS ,
178+ CompletionMetricsQualityOptions ._printMissedCompletionDetails ,
179179 help:
180180 'Print detailed information every time a completion request fails '
181181 'to produce a suggestions matching the expected suggestion.' ,
182182 negatable: false ,
183183 )
184184 ..addFlag (
185- CompletionMetricsQualityOptions .PRINT_MISSED_COMPLETION_SUMMARY ,
185+ CompletionMetricsQualityOptions ._printMissedCompletionSummary ,
186186 help:
187187 'Print summary information about the times that a completion '
188188 'request failed to produce a suggestions matching the expected '
189189 'suggestion.' ,
190190 negatable: false ,
191191 )
192192 ..addFlag (
193- CompletionMetricsQualityOptions .PRINT_MISSING_INFORMATION ,
193+ CompletionMetricsQualityOptions ._printMissingInformation ,
194194 help:
195195 'Print information about places where no completion location was '
196196 'computed and about information that is missing in the completion '
197197 'tables.' ,
198198 negatable: false ,
199199 )
200200 ..addFlag (
201- CompletionMetricsQualityOptions .PRINT_MRR_BY_LOCATION ,
201+ CompletionMetricsQualityOptions ._printMrrByLocation ,
202202 help:
203203 'Print information about the mrr score achieved at each completion '
204204 'location. This can help focus efforts to improve the overall '
@@ -207,22 +207,22 @@ ArgParser createArgParser() {
207207 negatable: false ,
208208 )
209209 ..addFlag (
210- CompletionMetricsQualityOptions .PRINT_SHADOWED_COMPLETION_DETAILS ,
210+ CompletionMetricsQualityOptions ._printShadowedCompletionDetails ,
211211 help:
212212 'Print detailed information every time a completion request '
213213 'produces a suggestion whose name matches the expected suggestion '
214214 'but that is referencing a different element' ,
215215 negatable: false ,
216216 )
217217 ..addFlag (
218- CompletionMetricsOptions .PRINT_SLOWEST_RESULTS ,
218+ CompletionMetricsOptions .printSlowestResultsFlag ,
219219 help:
220220 'Print information about the completion requests that were the '
221221 'slowest to return suggestions.' ,
222222 negatable: false ,
223223 )
224224 ..addFlag (
225- CompletionMetricsQualityOptions .PRINT_WORST_RESULTS ,
225+ CompletionMetricsQualityOptions ._printWorstResults ,
226226 help:
227227 'Print information about the completion requests that had the '
228228 'worst mrr scores.' ,
@@ -691,34 +691,34 @@ class CompletionMetricsQualityOptions extends CompletionMetricsOptions {
691691 /// A flag that causes detailed information to be printed every time a
692692 /// completion request fails to produce a suggestions matching the expected
693693 /// suggestion.
694- static const String PRINT_MISSED_COMPLETION_DETAILS =
694+ static const String _printMissedCompletionDetails =
695695 'print-missed-completion-details' ;
696696
697697 /// A flag that causes summary information to be printed about the times that
698698 /// a completion request failed to produce a suggestions matching the expected
699699 /// suggestion.
700- static const String PRINT_MISSED_COMPLETION_SUMMARY =
700+ static const String _printMissedCompletionSummary =
701701 'print-missed-completion-summary' ;
702702
703703 /// A flag that causes information to be printed about places where no
704704 /// completion location was computed and about information that's missing in
705705 /// the completion tables.
706- static const String PRINT_MISSING_INFORMATION = 'print-missing-information' ;
706+ static const String _printMissingInformation = 'print-missing-information' ;
707707
708708 /// A flag that causes information to be printed about the mrr score achieved
709709 /// at each completion location.
710- static const String PRINT_MRR_BY_LOCATION = 'print-mrr-by-location' ;
710+ static const String _printMrrByLocation = 'print-mrr-by-location' ;
711711
712712 /// A flag that causes detailed information to be printed every time a
713713 /// completion request produce a suggestions whose name matches the expected
714714 /// suggestion but that is referencing a different element (one that's
715715 /// shadowed by the correct element).
716- static const String PRINT_SHADOWED_COMPLETION_DETAILS =
716+ static const String _printShadowedCompletionDetails =
717717 'print-shadowed-completion-details' ;
718718
719719 /// A flag that causes information to be printed about the completion requests
720720 /// that had the worst mrr scores.
721- static const String PRINT_WORST_RESULTS = 'print-worst-results' ;
721+ static const String _printWorstResults = 'print-worst-results' ;
722722
723723 /// A flag indicating whether information should be printed every time a
724724 /// completion request fails to produce a suggestions matching the expected
@@ -749,15 +749,18 @@ class CompletionMetricsQualityOptions extends CompletionMetricsOptions {
749749 final bool printWorstResults;
750750
751751 CompletionMetricsQualityOptions (super .results)
752- : printMissedCompletionDetails =
753- results[PRINT_MISSED_COMPLETION_DETAILS ] as bool ,
754- printMissedCompletionSummary =
755- results[PRINT_MISSED_COMPLETION_SUMMARY ] as bool ,
756- printMissingInformation = results[PRINT_MISSING_INFORMATION ] as bool ,
757- printMrrByLocation = results[PRINT_MRR_BY_LOCATION ] as bool ,
758- printShadowedCompletionDetails =
759- results[PRINT_SHADOWED_COMPLETION_DETAILS ] as bool ,
760- printWorstResults = results[PRINT_WORST_RESULTS ] as bool ;
752+ : printMissedCompletionDetails = results.flag (
753+ _printMissedCompletionDetails,
754+ ),
755+ printMissedCompletionSummary = results.flag (
756+ _printMissedCompletionSummary,
757+ ),
758+ printMissingInformation = results.flag (_printMissingInformation),
759+ printMrrByLocation = results.flag (_printMrrByLocation),
760+ printShadowedCompletionDetails = results.flag (
761+ _printShadowedCompletionDetails,
762+ ),
763+ printWorstResults = results.flag (_printWorstResults);
761764}
762765
763766/// This is the main metrics computer class for code completions. After the
0 commit comments