6

Is it possible to let Visual Studio Code to index file content? Right now in my C code project when I want to find some declarations or calls or just search for string in content of files in the project I have to wait a long time to get results and one wrong click and I have to repeat the search again and wait again.

Would be great to know if it is possible to index all project files (with exclude rules) and saved search results to avoid research the same things.

Plus how to handle the file changes (reindex). Any help for this? Thanks.

music2myear
  • 49,799
Manium
  • 71

2 Answers2

3

Visual Studio Code can have index a folder, just as a table of contents of all exportable variables and functions within its files, by including an index.js file inside the ComponentOne directory.

The Indexify extension simplifies turning this on:

Index files (index.js/index.ts) act as a directory's table of contents. They are great for tracking exportable functions and variables. They allow you to easily import them into your codebase without having to dig them up from buried sub-directories.

The only problem is manually keeping track of all your exports and updating index files. That's where Indexify comes in!

Indexify adds options to your context menu to auto-generate index files on the fly. All you have to do is right-click on any directory in the explorer and select either a shallow index (indexes only the root of the selected directory) or a deep index (indexes all nested directories)

You may read a more detailed description of the extension in Effortless Index Files with VS Code.

For brute textual search, if VS Code is too slow, you could search for a third-party utility.

harrymc
  • 498,455
-2

Your VS Code application itself might be slow, check for that, restart and try again.

If you are working on a host with remote connection, then VS code will be slow some times because of network latency or if any extensions are being installed on remote host while the search task is going on then also search functionality will be slower.