Support import fix for missing namespace as well
This commit is contained in:
parent
9e127967b6
commit
aa706d785b
2 changed files with 16 additions and 0 deletions
|
@ -114,6 +114,7 @@ namespace ts.codefix {
|
|||
registerCodeFix({
|
||||
errorCodes: [
|
||||
Diagnostics.Cannot_find_name_0.code,
|
||||
Diagnostics.Cannot_find_namespace_0.code,
|
||||
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code
|
||||
],
|
||||
getCodeActions: (context: CodeFixContext) => {
|
||||
|
|
15
tests/cases/fourslash/importNameCodeFixNewImportFile3.ts
Normal file
15
tests/cases/fourslash/importNameCodeFixNewImportFile3.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
//// [|let t: XXX/*0*/.I;|]
|
||||
|
||||
// @Filename: ./module.ts
|
||||
//// export module XXX {
|
||||
//// export interface I {
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.importFixAtPosition([
|
||||
`import { XXX } from "./module";
|
||||
|
||||
let t: XXX.I;`
|
||||
]);
|
Loading…
Reference in a new issue