Skip to content

Autocomple import parent dir wrong when rootDirs is defined #30147

@juanluispaz

Description

@juanluispaz

TypeScript Version: 3.3.3333

If you configure in the tsconfig.json a rootDirs section like

{
    "compilerOptions": {
        "baseUrl": "src",
        "rootDirs": [
            "src",
            "src_gen"
        ]
    }
}

When you try autocomplete an import from the parent folder (..) in a subfolder the subjections are wrong, on linux (where I tested) it add all the valid completitions as well the content of the system root (/) foolder.

Example

File src/example/example.tsx

import { exampleImport } from '../[autocomplete here]'

Try to autocomplete after ../ the displayed options are wrong, it add a lot of extra invalid options.

Note: It only happens when you are listing the ../ autocomplete options, if you already selected a subfolder inside ../ (e.g. ../shared/) it works properly.

Maybe related to: #28550 and #30148

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions