Skip to content

Commit c0023be

Browse files
Update test cases to verify the fix and improve documentation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
1 parent 01fc25c commit c0023be

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tests/cases/fourslash/completionsSymbolAutoimportFromTypeOnlyImport.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/// <reference path="fourslash.ts" />
22

3+
// Test for issue #61894: Symbol auto-import bug with existing type-only imports
4+
// Verifies that symbols used in element access expressions are imported as values,
5+
// not added to existing type-only imports, when completing inside thing[...]
6+
37
// @noLib: true
48

59
// @Filename: /globals.d.ts
@@ -32,7 +36,7 @@ verify.completions({
3236
},
3337
});
3438

35-
// This should demonstrate the bug - the symbol should be imported as a value, not as a type
39+
// Verify the fix - the symbol should be imported as a value, not as a type
3640
verify.applyCodeActionFromCompletion("", {
3741
name: "SYM_FOO_BAR",
3842
source: "/exportsSymbol",

tests/cases/fourslash/completionsSymbolAutoimportFromTypeOnlyImportControl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/// <reference path="fourslash.ts" />
22

3+
// Control test for issue #61894: Symbol auto-import without existing type-only imports
4+
// Verifies that symbols are correctly imported as values when there are no existing imports
5+
36
// @noLib: true
47

58
// @Filename: /globals.d.ts

0 commit comments

Comments
 (0)