ChristianKohler/NpmIntellisense

Support subfolder intellisense for scoped npm packages

Opened this issue · 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!

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