Support import fix for missing namespace as well

This commit is contained in:
Zhengbo Li 2017-01-10 17:28:05 -08:00
parent 9e127967b6
commit aa706d785b
2 changed files with 16 additions and 0 deletions

View file

@ -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) => {

View 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;`
]);