Skip to content

Fix bug: normalize path after combining#21100

Merged
1 commit merged into
masterfrom
completionsPaths_pathMapping_parentDirectory
Jan 9, 2018
Merged

Fix bug: normalize path after combining#21100
1 commit merged into
masterfrom
completionsPaths_pathMapping_parentDirectory

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 9, 2018

Fixes #19113 (the one remaining bug as far as I can tell)
(Continuation of #21072)

@ghost ghost requested a review from armanio123 January 9, 2018 19:20
@ghost ghost merged commit fed34cd into master Jan 9, 2018
@ghost ghost deleted the completionsPaths_pathMapping_parentDirectory branch January 9, 2018 19:54
@web-dave
Copy link
Copy Markdown

Is this fix in the released version? Face the issue: build is OK but vscode says error.

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 1, 2018

@web-dave It's possible that vscode is using a different TypeScript version than your build. Could you check that both are using typescript@next (in vscode it should tell you the TS version in the lower-right -- instructions here), and file a new issue if there is one?
EDIT: Actually, this PR won't affect a command-line build because it only affects completions.

@baflo
Copy link
Copy Markdown

baflo commented Feb 2, 2018

@Andy-MS I'm running 2.7.1 in my workspace and with vscode. But I don't get code completion running as expected (it would work with app/... though):

image

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 2, 2018

@baflo I was able to get completions in 2.7.1 using:

tsconfig.json:

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

src/a.ts: import {} from "@app"; (type a / after @app to get completions)

src/app/b.ts: export const x = 0;

Does this work for you? If so, could you try and get a simplified version of your situation that doesn't have the completions?

@baflo
Copy link
Copy Markdown

baflo commented Feb 4, 2018

Hey @Andy-MS , I played a bit with your config. And I kind of get positive results. But not continuously.

Say I have your structure, but additionally a folder src/c with files src/c/c.ts and src/c/index.ts, then I can resolve b.ts but not files in src/c (only when I manually add the c/):

image

image

With the baseUrl setting it works well, however:

image

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 5, 2018

@baflo Thanks, looks like that was a bug that didn't show up in tests due to our test host differing from the real one.

@pie6k
Copy link
Copy Markdown

pie6k commented Feb 6, 2018

I've set VS Code ts version to 2.7 and I'm still having issue with paths not working properly

image

image

image

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 6, 2018

@pie6k Thanks, fixed in #21704

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants