File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ namespace ts.codefix {
44    const  errorCodes  =  [ 
55        Diagnostics . Property_0_does_not_exist_on_type_1_Did_you_mean_2 . code , 
66        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 , 
79        Diagnostics . Module_0_has_no_exported_member_1_Did_you_mean_2 . code , 
810    ] ; 
911    registerCodeFix ( { 
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ namespace ts.codefix {
44    const  errorCodes : ReadonlyArray < number >  =  [ 
55        Diagnostics . Cannot_find_name_0 . code , 
66        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 , 
79        Diagnostics . Cannot_find_namespace_0 . code , 
810        Diagnostics . _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead . code , 
911        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 11/// <reference path='fourslash.ts' /> 
22
3+ // @Filename : /a.ts 
4+ ////export const foo = 0; 
5+ 
6+ // @Filename : /b.ts 
7+ ////const fooo = 0; 
38////class C { 
49////    foo: number; 
510////    constructor() {[| 
611////        foo = 10; 
712////    |] } 
813//// } 
914
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+ ] ) ; 
1021verify . codeFix ( { 
22+     index : 2 , 
1123    description : "Add 'this.' to unresolved variable" , 
1224    newRangeContent : ` 
1325        this.foo = 10; 
Original file line number Diff line number Diff line change @@ -609,7 +609,7 @@ declare namespace FourSlashInterface {
609609    export  interface  VerifyCodeFixAvailableOptions  { 
610610        readonly  description : string ; 
611611        readonly  actions ?: ReadonlyArray < {  readonly  type : string ,  readonly  data : { }  } > ; 
612-         readonly  commands ?: ReadonlyArray < { } ? ; 
612+         readonly  commands ?: ReadonlyArray < { } > ; 
613613    } 
614614
615615    interface  VerifyNavigateToOptions  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments