Skip to content

Import path autocomplete with tsconfig path containing "/" #40572

@s4m0r4m4

Description

@s4m0r4m4

TypeScript Version: 4.0.2

Search Terms: import path autocomplete tsconfig path slash duplicate text

Code
tsconfig snippet:

{
   "compilerOptions": {
       "paths": {
            "@myproj/lib-123": ["libs/lib123/index.ts"]
       }
    }
}

Behavior in any typescript file:

// Start typing this and an auto-complete suggestion comes up for "@myproj/lib-123" (yay):
import { xyz } from "@myproj/lib-
// But when I select the autocomplete, it inserts this (oops):
import { xyz } from "@myproj/@myproj/lib-123"

Expected behavior:
import { xyz } from "@myproj/lib-123"

Actual behavior:
import { xyz } from "@myproj/@myproj/lib-123"
If the tsconfig shortcut does not contain a "/" this works just fine

Playground Link: I imagine this is not necessary here, let me know.

Related Issues: None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions