Sublime Forum

Index_include from within an index_exclude

#1

First, is this possible:

Add node_modules to the index_exclude_patterns setting, yet include a directory that is within the node_modules directory?

For work, I have private modules I work with that I need/would like to access with Goto Definition. However, I don’t want to index all of node_modules to get it.

Something like this is what I was expecting to be able to do:

"index_exclude_patterns": ["node_modules/"],
"index_include_patterns": ["node_modules/private-module/"],

Is there some wildcard I can add to the exclude setting? Similar to Find in Files?

"index_exclude_patterns": ["node_modules/", "-node_modules/private-module/"],

(This doesn’t make logical sense, “don’t look in this directory, but actually look in it for this other directory”; I’m wondering if there’s something similar that Sublime understands.)

Related topics in the forum are unanswered. I’ve also experimented, and failed, with the binary_file_patterns setting.

Thank you so much if you’re able to help with this or at least point me in the right direction.

0 Likes

#2

No, this is not possible. As soon as you exclude a directory, it won’t be scanned and no further filters will be applied.

You can, however, add that special folder you wanted to reinclude as a separate folder to your project (drag it onto the st window or use the Project menu).

0 Likes

#3

Awesome. Thanks for the reply.

0 Likes