Skip to content

Autocomple import ignore rootDirs #30148

@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 the subjections ignore what is available in the rootDirs, only show the options available in the same folder of the editing file.

Example

File src/example/example.tsx

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

Try to autocomplete after ./, ../, or any subfolder, the displayed options are only the options available in the src folder, but not the options available in the src_gen folder.

Note: No matter the folder's order in the rootDirs sections, the result is the same. The value of the baseUrl option is not important for reproduce this behaviour.

Maybe related to: #28550 and #30147

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions