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

import (absolute path) suggestions break in 1.17 with @typings installed #37132

Closed
wesleymostien opened this issue Oct 30, 2017 · 5 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues

Comments

@wesleymostien
Copy link

Problem:

Path suggestions for absolute paths (configured in tsconfig) break for import statements in version 1.17 as soon as @typings are installed.

Without the @typings folder anywhere in the project, everything works fine.
In version 1.16.1 it even works fine WITH the typings installed :

screen shot 2017-10-30 at 11 50 43

But when I do for instance :

npm i @types/node

after that is installed, this is what I get for suggestions instead of above screenshot (it seems that it only suggests installed types) :

screen shot 2017-10-30 at 11 50 18

  • VSCode Version: Code 1.17.2 (b813d12, 2017-10-16T13:47:41.889Z)
  • OS Version: Darwin x64 16.7.0
  • Extensions:
Extension Author (truncated) Version
bracket-pair-colorizer Coe 0.10.10
beautify Hoo 1.1.1
material-icon-theme PKi 2.2.4
path-intellisense chr 1.4.2
vue-peek dar 1.0.2
vscode-eslint dba 1.4.0
ts-tslint eg2 0.0.4
tslint eg2 1.0.13
prettier-vscode esb 0.24.0
docthis joe 0.6.0
vetur oct 0.10.1
typescript-hero rbb 1.6.0
guides spy 0.9.0
vscode-todo-highlight way 0.5.11
JavaScriptSnippets xab 1.5.0

(1 theme extensions excluded)


Steps to Reproduce:

  1. configure absolute path for typescript project in tsconfig. eg :
{
  "compilerOptions": {
    "target": "es6",
    "lib": ["dom", "es2015", "es2017"],
    "module": "commonjs",
    "moduleResolution": "node",
    "baseUrl": "./",
    "paths": {
      "@*": ["./*"]
    }
  }
}
  1. start typing
import whatever from '@/'

Reproduces without extensions: No (doesn't work either way)

@vscodebot vscodebot bot added the javascript JavaScript support issues label Oct 30, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 30, 2017

I believe the original suggestions may have come from your path-intellisense extension. I say that because I don't know think we ever properly supported the paths config option for our built-in path intellisense (microsoft/TypeScript#19113)

Using VS Code insiders, can you try setting "typescript.quickSuggestionsForPaths": false. This should prevent our built-in path intellisense from automatically kicking in

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Oct 30, 2017
@airato
Copy link

airato commented Nov 1, 2017

I've tried with latest VS Code Insiders – import path autocomplete does not recognize tsconfig's paths option correctly. Keys from the paths map appear as is, they are not being processed from globs to matches.
Tried with and without quickSuggestionsForPaths, path-intellisense extension.

Version 1.18.0-insider (1.18.0-insider), 2ab10d5, 2017-11-01T06:07:36.569Z

{
  "compilerOptions": {
    "target": "es6",
    "lib": ["dom", "es2015", "es2017"],
    "module": "commonjs",
    "moduleResolution": "node",
    "baseUrl": "./",
    "paths": {
      "~/*": ["src/*"]
    }
  }
}

image

cc @MiguelMadero

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 2, 2017

@airato Yes that is microsoft/TypeScript#19113

@vscodebot vscodebot bot closed this as completed Nov 9, 2017
@vscodebot
Copy link

vscodebot bot commented Nov 9, 2017

This issue has been closed automatically because it needs more information and has not had recent activity. Please refer to our guidelines for filing issues. Thank you for your contributions.

@jtsom
Copy link

jtsom commented Dec 13, 2017

Why was this closed?? It's still an issue!!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

4 participants