• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / bslint / #592

pending completion
#592

push

TwitchBronBron
0.7.6

672 of 767 branches covered (87.61%)

Branch coverage included in aggregate %.

800 of 843 relevant lines covered (94.9%)

56.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/plugins/trackCodeFlow/trackFixes.ts
1
import { BscFile, BsDiagnostic, Range } from 'brighterscript';
2
import { ChangeEntry, replaceText } from '../../textEdit';
1✔
3
import { VarLintError } from './varTracking';
1✔
4

5
export function extractFixes(
1✔
6
    addFixes: (file: BscFile, changes: ChangeEntry) => void,
7
    diagnostics: BsDiagnostic[]
8
): BsDiagnostic[] {
9
    return diagnostics.filter(diagnostic => {
1✔
10
        const fix = getFixes(diagnostic);
7✔
11
        if (fix) {
7✔
12
            addFixes(diagnostic.file, fix);
6✔
13
            return false;
6✔
14
        }
15
        return true;
1✔
16
    });
17
}
18

19
export function getFixes(diagnostic: BsDiagnostic): ChangeEntry {
1✔
20
    switch (diagnostic.code) {
7✔
21
        case VarLintError.CaseMismatch:
7✔
22
            return fixCasing(diagnostic);
6✔
23
        default:
24
            return null;
1✔
25
    }
26
}
27

28
function fixCasing(diagnostic: BsDiagnostic) {
29
    const data: { name: string; range: Range } = diagnostic.data;
6✔
30
    return {
6✔
31
        diagnostic,
32
        changes: [
33
            replaceText(data.range, data.name)
34
        ]
35
    };
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc