Skip to content

Commit 8a98171

Browse files
committed
removed unused file and fixed indents
1 parent 382eb54 commit 8a98171

File tree

6 files changed

+188
-214
lines changed

6 files changed

+188
-214
lines changed

dist/worker/ref/Geometry/Geometry.d.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

lib/main/lang/fixmyts/quickFixRegistry.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ import {TypeAssertPropertyAccessToType} from "./quickFixes/typeAssertPropertyAcc
1818
import {ImplementInterface} from "./quickFixes/implementInterface";
1919
import {SingleLineCommentToJsdoc} from "./quickFixes/singleLineCommentToJsdoc";
2020
export var allQuickFixes: QuickFix[] = [
21-
new AddClassMethod(),
22-
new AddClassMember(),
23-
new AddImportDefaultStatement(),
24-
new AddImportFromStatement(),
25-
new AddImportStatement(),
26-
new WrapInProperty(),
27-
new EqualsToEquals(),
28-
new ExtractVariable(),
29-
new StringConcatToTemplate(),
30-
new QuotesToQuotes(),
31-
new QuoteToTemplate(),
32-
new TypeAssertPropertyAccessToAny(),
33-
new TypeAssertPropertyAccessToType(),
34-
new ImplementInterface(),
35-
new SingleLineCommentToJsdoc()
36-
];
21+
new AddClassMethod(),
22+
new AddClassMember(),
23+
new AddImportDefaultStatement(),
24+
new AddImportFromStatement(),
25+
new AddImportStatement(),
26+
new WrapInProperty(),
27+
new EqualsToEquals(),
28+
new ExtractVariable(),
29+
new StringConcatToTemplate(),
30+
new QuotesToQuotes(),
31+
new QuoteToTemplate(),
32+
new TypeAssertPropertyAccessToAny(),
33+
new TypeAssertPropertyAccessToType(),
34+
new ImplementInterface(),
35+
new SingleLineCommentToJsdoc()
36+
];

lib/main/lang/fixmyts/quickFixes/addImportDefaultStatement.ts

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,74 @@ import {getPathCompletions} from "../../modules/getPathCompletions";
99

1010
function getIdentifierAndFileNames(error: ts.Diagnostic, project: Project) {
1111

12-
var errorText: string = <any>error.messageText;
12+
var errorText: string = <any>error.messageText;
1313

14-
// We don't support error chains yet
15-
if (typeof errorText !== 'string') {
16-
return undefined;
17-
};
14+
// We don't support error chains yet
15+
if (typeof errorText !== 'string') {
16+
return undefined;
17+
};
1818

19-
var match = errorText.match(/Cannot find name \'(\w+)\'./);
19+
var match = errorText.match(/Cannot find name \'(\w+)\'./);
2020

21-
// If for whatever reason the error message doesn't match
22-
if (!match) return;
21+
// If for whatever reason the error message doesn't match
22+
if (!match) return;
2323

24-
var [, identifierName] = match;
25-
var {files} = getPathCompletions({
26-
project,
27-
filePath: error.file.fileName,
28-
prefix: identifierName,
29-
includeExternalModules: false
30-
});
31-
var file = files.length > 0 ? files[0].relativePath : undefined;
32-
var basename = files.length > 0 ? files[0].name : undefined;
33-
return { identifierName, file, basename };
24+
var [, identifierName] = match;
25+
var {files} = getPathCompletions({
26+
project,
27+
filePath: error.file.fileName,
28+
prefix: identifierName,
29+
includeExternalModules: false
30+
});
31+
var file = files.length > 0 ? files[0].relativePath : undefined;
32+
var basename = files.length > 0 ? files[0].name : undefined;
33+
return { identifierName, file, basename };
3434
}
3535

3636
export class AddImportDefaultStatement implements QuickFix {
37-
key = AddImportDefaultStatement.name;
37+
key = AddImportDefaultStatement.name;
3838

39-
canProvideFix(info: QuickFixQueryInformation): CanProvideFixResponse {
40-
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
41-
if (!relevantError) return;
42-
if (info.positionNode.kind !== ts.SyntaxKind.Identifier) return;
43-
var matches = getIdentifierAndFileNames(relevantError, info.project);
44-
if (!matches) return;
45-
var { identifierName, file} = matches;
46-
return file ? { display: `import ${identifierName} from \"${file}\"` } : undefined;
47-
}
39+
canProvideFix(info: QuickFixQueryInformation): CanProvideFixResponse {
40+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
41+
if (!relevantError) return;
42+
if (info.positionNode.kind !== ts.SyntaxKind.Identifier) return;
43+
var matches = getIdentifierAndFileNames(relevantError, info.project);
44+
if (!matches) return;
45+
var { identifierName, file} = matches;
46+
return file ? { display: `import ${identifierName} from \"${file}\"` } : undefined;
47+
}
4848

49-
provideFix(info: QuickFixQueryInformation): Refactoring[] {
50-
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
51-
var identifier = <ts.Identifier>info.positionNode;
49+
provideFix(info: QuickFixQueryInformation): Refactoring[] {
50+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
51+
var identifier = <ts.Identifier>info.positionNode;
5252

53-
var identifierName = identifier.text;
54-
var fileNameforFix = getIdentifierAndFileNames(relevantError, info.project);
55-
// Add stuff at the top of the file
56-
let refactorings: Refactoring[] = [{
57-
span: {
58-
start: 0,
59-
length: 0
60-
},
61-
newText: `import ${identifierName} from \"${fileNameforFix.file}\";${EOL}`,
62-
filePath: info.sourceFile.fileName
63-
}];
53+
var identifierName = identifier.text;
54+
var fileNameforFix = getIdentifierAndFileNames(relevantError, info.project);
55+
// Add stuff at the top of the file
56+
let refactorings: Refactoring[] = [{
57+
span: {
58+
start: 0,
59+
length: 0
60+
},
61+
newText: `import ${identifierName} from \"${fileNameforFix.file}\";${EOL}`,
62+
filePath: info.sourceFile.fileName
63+
}];
6464

65-
// Also refactor the variable name to match the file name
66-
// TODO: the following code only takes into account location
67-
// There may be other locations where this is used.
68-
// Better that they trigger a *rename* explicitly later if they want to rename the variable
69-
// if (identifierName !== fileNameforFix.basename) {
70-
// refactorings.push({
71-
// span: {
72-
// start: identifier.getStart(),
73-
// length: identifier.end - identifier.getStart()
74-
// },
75-
// newText: fileNameforFix.basename,
76-
// filePath: info.srcFile.fileName
77-
// })
78-
// }
65+
// Also refactor the variable name to match the file name
66+
// TODO: the following code only takes into account location
67+
// There may be other locations where this is used.
68+
// Better that they trigger a *rename* explicitly later if they want to rename the variable
69+
// if (identifierName !== fileNameforFix.basename) {
70+
// refactorings.push({
71+
// span: {
72+
// start: identifier.getStart(),
73+
// length: identifier.end - identifier.getStart()
74+
// },
75+
// newText: fileNameforFix.basename,
76+
// filePath: info.srcFile.fileName
77+
// })
78+
// }
7979

80-
return refactorings;
81-
}
80+
return refactorings;
81+
}
8282
}

lib/main/lang/fixmyts/quickFixes/addImportFromStatement.ts

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,74 @@ import {getPathCompletions} from "../../modules/getPathCompletions";
99

1010
function getIdentifierAndFileNames(error: ts.Diagnostic, project: Project) {
1111

12-
var errorText: string = <any>error.messageText;
12+
var errorText: string = <any>error.messageText;
1313

14-
// We don't support error chains yet
15-
if (typeof errorText !== 'string') {
16-
return undefined;
17-
};
14+
// We don't support error chains yet
15+
if (typeof errorText !== 'string') {
16+
return undefined;
17+
};
1818

19-
var match = errorText.match(/Cannot find name \'(\w+)\'./);
19+
var match = errorText.match(/Cannot find name \'(\w+)\'./);
2020

21-
// If for whatever reason the error message doesn't match
22-
if (!match) return;
21+
// If for whatever reason the error message doesn't match
22+
if (!match) return;
2323

24-
var [, identifierName] = match;
25-
var {files} = getPathCompletions({
26-
project,
27-
filePath: error.file.fileName,
28-
prefix: identifierName,
29-
includeExternalModules: false
30-
});
31-
var file = files.length > 0 ? files[0].relativePath : undefined;
32-
var basename = files.length > 0 ? files[0].name : undefined;
33-
return { identifierName, file, basename };
24+
var [, identifierName] = match;
25+
var {files} = getPathCompletions({
26+
project,
27+
filePath: error.file.fileName,
28+
prefix: identifierName,
29+
includeExternalModules: false
30+
});
31+
var file = files.length > 0 ? files[0].relativePath : undefined;
32+
var basename = files.length > 0 ? files[0].name : undefined;
33+
return { identifierName, file, basename };
3434
}
3535

3636
export class AddImportFromStatement implements QuickFix {
37-
key = AddImportFromStatement.name;
37+
key = AddImportFromStatement.name;
3838

39-
canProvideFix(info: QuickFixQueryInformation): CanProvideFixResponse {
40-
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
41-
if (!relevantError) return;
42-
if (info.positionNode.kind !== ts.SyntaxKind.Identifier) return;
43-
var matches = getIdentifierAndFileNames(relevantError, info.project);
44-
if (!matches) return;
45-
var { identifierName, file} = matches;
46-
return file ? { display: `import {${identifierName}} from \"${file}\"` } : undefined;
47-
}
39+
canProvideFix(info: QuickFixQueryInformation): CanProvideFixResponse {
40+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
41+
if (!relevantError) return;
42+
if (info.positionNode.kind !== ts.SyntaxKind.Identifier) return;
43+
var matches = getIdentifierAndFileNames(relevantError, info.project);
44+
if (!matches) return;
45+
var { identifierName, file} = matches;
46+
return file ? { display: `import {${identifierName}} from \"${file}\"` } : undefined;
47+
}
4848

49-
provideFix(info: QuickFixQueryInformation): Refactoring[] {
50-
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
51-
var identifier = <ts.Identifier>info.positionNode;
49+
provideFix(info: QuickFixQueryInformation): Refactoring[] {
50+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
51+
var identifier = <ts.Identifier>info.positionNode;
5252

53-
var identifierName = identifier.text;
54-
var fileNameforFix = getIdentifierAndFileNames(relevantError, info.project);
55-
// Add stuff at the top of the file
56-
let refactorings: Refactoring[] = [{
57-
span: {
58-
start: 0,
59-
length: 0
60-
},
61-
newText: `import {${identifierName}} from \"${fileNameforFix.file}\";${EOL}`,
62-
filePath: info.sourceFile.fileName
63-
}];
53+
var identifierName = identifier.text;
54+
var fileNameforFix = getIdentifierAndFileNames(relevantError, info.project);
55+
// Add stuff at the top of the file
56+
let refactorings: Refactoring[] = [{
57+
span: {
58+
start: 0,
59+
length: 0
60+
},
61+
newText: `import {${identifierName}} from \"${fileNameforFix.file}\";${EOL}`,
62+
filePath: info.sourceFile.fileName
63+
}];
6464

65-
// Also refactor the variable name to match the file name
66-
// TODO: the following code only takes into account location
67-
// There may be other locations where this is used.
68-
// Better that they trigger a *rename* explicitly later if they want to rename the variable
69-
// if (identifierName !== fileNameforFix.basename) {
70-
// refactorings.push({
71-
// span: {
72-
// start: identifier.getStart(),
73-
// length: identifier.end - identifier.getStart()
74-
// },
75-
// newText: fileNameforFix.basename,
76-
// filePath: info.srcFile.fileName
77-
// })
78-
// }
65+
// Also refactor the variable name to match the file name
66+
// TODO: the following code only takes into account location
67+
// There may be other locations where this is used.
68+
// Better that they trigger a *rename* explicitly later if they want to rename the variable
69+
// if (identifierName !== fileNameforFix.basename) {
70+
// refactorings.push({
71+
// span: {
72+
// start: identifier.getStart(),
73+
// length: identifier.end - identifier.getStart()
74+
// },
75+
// newText: fileNameforFix.basename,
76+
// filePath: info.srcFile.fileName
77+
// })
78+
// }
7979

80-
return refactorings;
81-
}
80+
return refactorings;
81+
}
8282
}

lib/main/lang/fixmyts/quickFixes/addImportStatement.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class AddImportStatement implements QuickFix {
3737
key = AddImportStatement.name;
3838

3939
canProvideFix(info: QuickFixQueryInformation): CanProvideFixResponse {
40-
var relevantError = info.positionErrors.filter(x=> x.code == 2304)[0];
40+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
4141
if (!relevantError) return;
4242
if (info.positionNode.kind !== ts.SyntaxKind.Identifier) return;
4343
var matches = getIdentifierAndFileNames(relevantError, info.project);
@@ -48,7 +48,7 @@ export class AddImportStatement implements QuickFix {
4848
}
4949

5050
provideFix(info: QuickFixQueryInformation): Refactoring[] {
51-
var relevantError = info.positionErrors.filter(x=> x.code == 2304)[0];
51+
var relevantError = info.positionErrors.filter(x => x.code == 2304)[0];
5252
var identifier = <ts.Identifier>info.positionNode;
5353

5454
var identifierName = identifier.text;
@@ -82,3 +82,4 @@ export class AddImportStatement implements QuickFix {
8282
return refactorings;
8383
}
8484
}
85+
}

0 commit comments

Comments
 (0)