Skip to content

Support path completions inside node_modules#19692

Merged
4 commits merged into
masterfrom
completionsNodeModules
Nov 3, 2017
Merged

Support path completions inside node_modules#19692
4 commits merged into
masterfrom
completionsNodeModules

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 2, 2017

Fixes #19121

@ghost ghost requested a review from armanio123 November 2, 2017 21:30
Comment thread src/services/pathCompletions.ts Outdated
}

if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) {
forEachAncestorDirectory(currentDirectory, ancestor => {
Copy link
Copy Markdown
Member

@sheetalkamat sheetalkamat Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldnt be from currentDirectory but from getDirectoryPath(scriptPath) isnt it ?

Refer to: https://github.com/Microsoft/TypeScript/blob/2ea723f3156b0e224d438330951e2bf1edf8c065/src/compiler/moduleNameResolver.ts#L751

@sheetalkamat
Copy link
Copy Markdown
Member

Test where current directory and script path are different would be good to add

// @Filename: /src/a.ts
////import {} from "/*1*/";
////import {} from "x//*2*/";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also suggest adding file /src/folder/b.ts and then adding same import statements there for the lookup

@ghost ghost merged commit 749e151 into master Nov 3, 2017
@ghost ghost deleted the completionsNodeModules branch November 3, 2017 22:05
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

1 participant