Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path intellisense not working for typescript short imports defined at compilerOptions paths #24649

Closed
MiguelLattuada opened this issue Apr 13, 2017 · 5 comments
Assignees
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@MiguelLattuada
Copy link

  • VSCode Version: 1.11.1
  • OS Version: Mac OS El Capitan (10.11.6)

Steps to Reproduce:

  1. Define some paths as the image shows.
    screen shot 2017-04-12 at 11 09 11 pm

  2. Write an import statement and you get no intellisense for files inside the folder.
    screen shot 2017-04-12 at 11 12 13 pm

Expected behavior:

  • Get the same intellisense as when you made file search.
    screen shot 2017-04-12 at 11 15 05 pm
@mjbvz mjbvz self-assigned this Apr 13, 2017
@mjbvz mjbvz added the typescript Typescript support issues label Apr 13, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 13, 2017

Does your tsconfig.json include a baseUrl?

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "models/*": ["app/src/*"]
        }
    },
}

Not configuring the baseUrlcauses paths not to work

@MiguelLattuada
Copy link
Author

MiguelLattuada commented Apr 13, 2017

It does.

{
  "compileOnSave": false,
  "compilerOptions": {
    "paths": {
      "models/*": [ "app/models/*" ],
      "interfaces/*": [ "app/interfaces/*" ],
      "services/*": [ "app/services/*" ]
    },
    "baseUrl": "src",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "ES6",
    "lib": [
      "es2016",
      "dom"
    ]
  }
}

@icopp
Copy link

icopp commented Jul 7, 2017

I've run into the same issue on Mac. The weird part is, it's completely intermittent - sometimes it works, sometimes it doesn't, with exactly the same repo.

@wesleymostien
Copy link

can't get this too work either, especially for .vue extensions

@mjbvz mjbvz added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Oct 16, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 16, 2017

I believe this bug is now being tracked by microsoft/TypeScript#19113

@mjbvz mjbvz closed this as completed Oct 16, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants