Skip to content

Jsconfig paths option for aliases causes intellisense issues #24278

@RonanQuigley

Description

@RonanQuigley

TypeScript Version: 2.9.0-dev.20180519

Search Terms: jsconfig, alias, webpack, paths, intellisense

When using the paths and baseUrl options in a jsconfig, why does the following happen when? [best to open the gif in another window]:

issue

In the gif you can see I have setup a couple of alias options via paths in the jsconfig. I'm using it for webpack aliases However, when navigating around, the "Folder1" path alias shows up despite me being inside the "Folder2" alias. Should code completion not recognise that I have stepped inside a folder listed in the jsconfig paths option and remove the other possible alias folders listed? You can also see that I have to use backspace then re-apply the "/" or type the correct matching first letter to the file name just to get intellisense to kick in.

Expected behavior: Intellisense should only show files/folders inside an aliased folder that was set via the jsconfig paths option. It show also show the possible child folders/files as I type.

Actual behavior: Intellisense displays other path aliased folders when entering a different folder that was already aliased via the paths option. Furthermore, I have to apply the "/" to get it to show up or continue typing with the first letter of known file names. It also shows the child folder even though I am already in it with the paths option I setup

I've also replicated this with typescript 2.8.3. This was the jsconfig I was using:

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "Folder1/*" : ["folder1/folder-1-child/*"], 
            "Folder2/*": ["folder2/folder-2-child/*"]
        }
    },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions