NpmIntellisense icon indicating copy to clipboard operation
NpmIntellisense copied to clipboard

Support subfolder intellisense for scoped npm packages

Open nachocodoner opened this issue 7 years ago • 1 comments

I have been testing the extension, concretely the experimental feature of npm subfolder intellisense, which works greats. However, when having scoped packages, such as @scope/package-name, it doesn't work.

I have been diving into the code and I have seen that the scoped scenario is not covered, the plugin always split from the first slash it finds, check out here.

Probably we just need to do something like:

const scopedPkg = /(@\w*\/\w*)\/?(.*)/g.exec(pkgFragment);
const pkgFragmentSplit = scopedPkg ? scopedPkg.slice(1, 3) : pkgFragment.split('/');
const packageName: string = pkgFragmentSplit[0];

I have tried to change that in a fork, but I am not experienced to debug a vscode extension yet. So I thought that you may provide this fix quicker, it may affect to other parts as well.

Thank you!

nachocodoner avatar Feb 10 '18 10:02 nachocodoner

Need this and ready to help. Could someone help with info on testing extensions from the fork/local package?

RusinovAnton avatar Mar 30 '18 09:03 RusinovAnton