It doesn't suggest some one symbol imports

Hey!

There is an unexpected behavior in WebStorm when I'm trying to import anything one symbol long. Please check the vdo:

As you can see, I created file fp-ts-imports.ts with content:

const Q = {
f: 1
};const E = {
f: 1
};

export { Q, W, E, R, T, Y, U, I, O, P, A, S, D, F, G, H, J, K, L, Z, X, C, V, B, N, M };

And then I checked which suggestions work in index.ts file sequentially trying different exported symbols.
The suggestion worked for Q, W, R, Y, U, I.
The suggestion didn't work for E and T.
It goes wrong for some other symbols, I made the video short to save your time.

This demo project contains only two files, so I think you can easily reproduce it.

The problem is much more deeper with the big projects with tons of dependencies. In such projects the majority of one symbol imports are missing from the suggestions scope.

I've tried to experiment with Code Completion settings, I had no luck with different options combinations.

My current Code Completion settings are these:

Also I checked whether it's a bug for local exports only or it also effects the packages. So I've published a package with one symbol export "O": https://www.npmjs.com/package/@body-link/test-1234-imports

Then I installed the package in a big project and I was expecting that WebStorm would give me a suggestion to import "O" from "@body-link/test-1234-imports". It didn't work:

But if I put "." after "O" WebStorm gives me a legit suggestions from "O" without being really imported:

I expect WebStorm always suggests all the exported variables and methods from local files and installed packages despite the length of the name of the exported things.

Thank you in advance 🙌

1 comment
Comment actions Permalink

Submitted as https://youtrack.jetbrains.com/issue/WEB-52935, please follow it for updates

Failed to reproduce the problem with O though:

0

Please sign in to leave a comment.