Skip to content

Commit aa706d7

Browse files
committed
Support import fix for missing namespace as well
1 parent 9e12796 commit aa706d7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/services/codefixes/importFixes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ namespace ts.codefix {
114114
registerCodeFix({
115115
errorCodes: [
116116
Diagnostics.Cannot_find_name_0.code,
117+
Diagnostics.Cannot_find_namespace_0.code,
117118
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code
118119
],
119120
getCodeActions: (context: CodeFixContext) => {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// [|let t: XXX/*0*/.I;|]
4+
5+
// @Filename: ./module.ts
6+
//// export module XXX {
7+
//// export interface I {
8+
//// }
9+
//// }
10+
11+
verify.importFixAtPosition([
12+
`import { XXX } from "./module";
13+
14+
let t: XXX.I;`
15+
]);

0 commit comments

Comments
 (0)