File tree 4 files changed +17
-1
lines changed
4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ namespace ts.codefix {
4
4
const errorCodes = [
5
5
Diagnostics . Property_0_does_not_exist_on_type_1_Did_you_mean_2 . code ,
6
6
Diagnostics . Cannot_find_name_0_Did_you_mean_1 . code ,
7
+ Diagnostics . Cannot_find_name_0_Did_you_mean_the_instance_member_this_0 . code ,
8
+ Diagnostics . Cannot_find_name_0_Did_you_mean_the_static_member_1_0 . code ,
7
9
Diagnostics . Module_0_has_no_exported_member_1_Did_you_mean_2 . code ,
8
10
] ;
9
11
registerCodeFix ( {
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ namespace ts.codefix {
4
4
const errorCodes : ReadonlyArray < number > = [
5
5
Diagnostics . Cannot_find_name_0 . code ,
6
6
Diagnostics . Cannot_find_name_0_Did_you_mean_1 . code ,
7
+ Diagnostics . Cannot_find_name_0_Did_you_mean_the_instance_member_this_0 . code ,
8
+ Diagnostics . Cannot_find_name_0_Did_you_mean_the_static_member_1_0 . code ,
7
9
Diagnostics . Cannot_find_namespace_0 . code ,
8
10
Diagnostics . _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead . code ,
9
11
Diagnostics . _0_only_refers_to_a_type_but_is_being_used_as_a_value_here . code ,
Original file line number Diff line number Diff line change 1
1
/// <reference path='fourslash.ts' />
2
2
3
+ // @Filename : /a.ts
4
+ ////export const foo = 0;
5
+
6
+ // @Filename : /b.ts
7
+ ////const fooo = 0;
3
8
////class C {
4
9
//// foo: number;
5
10
//// constructor() {[|
6
11
//// foo = 10;
7
12
//// |] }
8
13
//// }
9
14
15
+ goTo . file ( "/b.ts" ) ;
16
+ verify . codeFixAvailable ( [
17
+ { description : `Import 'foo' from module "./a"` } ,
18
+ { description : "Change spelling to 'fooo'" } ,
19
+ { description : "Add 'this.' to unresolved variable" } ,
20
+ ] ) ;
10
21
verify . codeFix ( {
22
+ index : 2 ,
11
23
description : "Add 'this.' to unresolved variable" ,
12
24
newRangeContent : `
13
25
this.foo = 10;
Original file line number Diff line number Diff line change @@ -609,7 +609,7 @@ declare namespace FourSlashInterface {
609
609
export interface VerifyCodeFixAvailableOptions {
610
610
readonly description : string ;
611
611
readonly actions ?: ReadonlyArray < { readonly type : string , readonly data : { } } > ;
612
- readonly commands ?: ReadonlyArray < { } ? ;
612
+ readonly commands ?: ReadonlyArray < { } > ;
613
613
}
614
614
615
615
interface VerifyNavigateToOptions {
You can’t perform that action at this time.
0 commit comments