Searching for index.js files

While using quick navigation/search It would be great if index.js files nested directly under a directory matching the query were considered matches.

 

Example:

While working on a project with the following following directory structure:

/actions/index.js

Currently a search for "actions" returns no matches. Instead it would be helpful if a search for "actions" would pull up actions/index.js as a match.

 

If this is possible already by tweaking something let me know.

Thanks!

 

7 comments

Hi there,

If you are searching for a folder, then you have to specify this nuance with using `/` ... because "Navigate | File" searches for files and not folders (as name suggests)

So .. "act/in" or just "act/" might be enough (depends on how many folders starting with "act" you have in your project) to show you the files from such folders.

0

Hi Andriy,

Yes I'm aware but unfortunately when including the `/` and then pressing return the file navigator opens up and displays the directory (as it should) instead of just opening the index.js file in the editor. To open the index.js file you need to also start typing `index` after the `/`.

Thanks for the info though!

Brent

1

I would also be useful if import actions from './actions' would actually resolve index.js file if it exists. 

4

It would be great if something like Igor suggested existed. Even more so if you could customize the file name pattern. I personally tend to use build plugins that allow me to write only the directory name and the 'default' file is imported. 

Such as import actions from './actions' with the full path actually being './actions/actions.js'. It reduces unnecessary boiler plate code. 

0

>It would be great if something like Igor suggested existed.

 

Directory imports (like import actions from './actions') are correctly resolved, WebStorm jumps to appropriate code in index.js

0

I tried the latest IU 2017.1 EAP with TypeScript. index.ts imports are not being resolved.

Is there a related bug / feature for it?

 

0

No, it's not an issue I'm aware of. Please make sure you have the latest compatible NodeJS plugin installed. If it doesn't help, please provide a project plus steps to repeat

0

Please sign in to leave a comment.