chromium / vs-chromium

A Visual Studio extension containing a collection of tools to help contributing code to the Chromium project.
BSD 3-Clause "New" or "Revised" License
311 stars 90 forks source link

Should have option to index other directories like CRT and Windows headers #48

Open randomascii opened 6 years ago

randomascii commented 6 years ago

When searching code it is often helpful to have all relevant header files indexed, not just the project's files. Typically this includes the VS CRT header files and the Windows SDK header files but could also include other external sources.

It would be very helpful if I could configure VsChromium so that it always scan/load specified directories. This could be a global setting or a per-project setting. I would probably most often use a global setting and would always add these two directories since they are applicable to most projects, and not huge enough that I care if they get pulled in unnecessarily.

VsChromium already handles having multiple directories loaded just fine so I think this should be straightforward.

muchcharles commented 5 years ago

I would like the same thing. Adding a symlink can be a workaround, but then the file is opened with the wrong path and visual studio will do things like open the same file twice (e.g. once through vs-chromium file paths search, once through jump to definition in vs) and not realize they are the same file.

rpaquay commented 4 years ago

Another option (as a workaround) is to create a vs-chromium-project.txt in the additional directories, and open those. VsChromium supports having multiple vs-chromium-project.txt files opened at the same time, and will search by default in all of them, grouping results per project.

As a future feature, it would be nice to extend the syntax of vs-chromium-project.txt to have an option like "additional-directory=" so that the process of referencing multiple directories can be done with a single project file.

randomascii commented 4 years ago

Having vs-chromium-project.txt have a way to point to additional directories would be great (note: directories, either semi-colon separated or with multiple additional-directory entries). I tend to copy vs-chromium-project.txt files from old locations to new ones and this would work well with that workflow.

muchcharles commented 3 years ago

Another option (as a workaround) is to create a vs-chromium-project.txt in the additional directories, and open those. VsChromium supports having multiple vs-chromium-project.txt files opened at the same time, and will search by default in all of them, grouping results per project.

How do you actually open two vs-chromium-project.txt files at once like this? When I place one next to my solution and another alongside a subproject they don't both show up as options inside the Server Information -> Details... window. The first is just automatically picked up, but what is the step to open the second one?

randomascii commented 3 years ago

I have vs-chromium-project.txt files in multiple folders, such as src/chromium and src/depot_tools. When I open a file from src/chromium (any file) it loads and indexes all of the code from there. If I subsequently load a file from src/depot_tools (again, any file) it loads and indexes all of the code from there. Any subsequent searches look through both locations. Results are grouped into src/chromium and src/depot_tools sections. It just works.

That said, the problem with dropping vs-chromium-project.txt files in the VS and SDK directories is that those directories are "owned" by Microsoft, and making modifications to them is undesirable. It also requires admin privileges to put the files there or edit them. And, it requires manually loading a file from those directories in order to trigger the indexing. It would be great if I could make them get indexed automatically when I load, say, src/chromium.