Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusion of windows SDK files from search #2320

Closed
fredijude opened this issue Jul 24, 2018 · 16 comments
Closed

Exclusion of windows SDK files from search #2320

fredijude opened this issue Jul 24, 2018 · 16 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@fredijude
Copy link

Type: Symbol Search Across Files
I am working on a big sized c++ code base. Its takes 10-15 s to bring up the results. But i see results from the windows sdk include files also which i don't want to. Is there any way i can exclude these files from search symbol across files and also increase the speed for the same.

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.25.1
  • C/C++ Extension Version: 0.17.7

Screenshots
search issue

@sean-mcmanus
Copy link
Contributor

Adding folders to search.exclude or files.exclude is supposed to work...but it looks like it's not working correctly for the Windows SDK.

@bobbrow
Copy link
Member

bobbrow commented Jul 24, 2018

I saw similar problems with the exclude yesterday (I was going to recommend it for #1119, but it didn't work). These may be considered the same issue.

@bobbrow bobbrow modified the milestones: Triage, On Deck Jul 24, 2018
@fredijude
Copy link
Author

@sean-mcmanus The search exclude and files exclude only excludes files from the current folder which i have opened. Also, I couldn't find any information on any configuration based on which this is done.

Anyways, normal go to file doesn't include these files whereas go to symbol across files brings up matches from these files. It will be great if you guys work on this and solve it or help me solve it.

@sean-mcmanus
Copy link
Contributor

Yeah, the lack of exclusions outside of the workspace is an issue we've had for a long time (see also #1066 )...I thought we had fixed it.

@fredijude
Copy link
Author

@sean-mcmanus : In the case of mine, i haven't included the paths, still it picks up and brings up only in symbol search explorer. I don't know why symbol search in workspace looks outside the workspace. I also think it is adding overhead to the performance of symbol search. It would be great if you could dug deep and solve this fundamentally so that performance can also be enhanced.

@bobbrow
Copy link
Member

bobbrow commented Jul 27, 2018

Most users consider the "workspace" to include all libraries required to build a component (STL included). So we pull in symbols based on what is set in compilerPath (or a compiler that we detect if compilerPath is not set) so that IntelliSense can work. If we exclude these, then goto defintion on std types won't work. That may be what you want, so we simply need to make the exclusions work or provide a setting that tells us not to index libraries outside the workspace folder.

@fredijude
Copy link
Author

@bobbrow : providing a setting to exclude STLs in search symbol across workspace would do the required. Kindly do give a fix asap.

@sean-mcmanus sean-mcmanus modified the milestones: On Deck, August 2018 Aug 2, 2018
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 2, 2018
@fredijude
Copy link
Author

@sean-mcmanus , @bobbrow : The Quick fix is highly appreciated. Thanks ! 👍

@bobbrow
Copy link
Member

bobbrow commented Aug 3, 2018

Sure. We're also changing the default to show just symbols in the workspace folder based on our observation of how other extensions behave. And contrary to my comment above, we can do this without causing goto definition to fail for these "external" types.

@fredijude
Copy link
Author

@bobbrow : Yeah, i went through the commit. :)

@sean-mcmanus
Copy link
Contributor

We have a build with the fix at https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.17.8-insiders if you want to try it out.

@fredijude
Copy link
Author

@sean-mcmanus : I installed and experienced the changes. I still believe that this needs an improvement in performance as it still takes more time.

@sean-mcmanus
Copy link
Contributor

There is a known performance problem on the first use of Go to Symbol in Workspace while it builds a cache (see #1686 ), but the later uses should be fast -- is that what you're observing or is it always slow? Also, if there's a red flame in the bottom right (i.e. soon after opening a file), the Go to Symbol messages can be stuck by that (see #1928 ).

@fredijude
Copy link
Author

@sean-mcmanus : I agree that the first use of go to symbol in workspace is slow as it build the cache, But why can't this be done as part of project loading only. It will really change the experience for the first time users which will have a drastic impact of the delight towards using the product.

@fredijude
Copy link
Author

@sean-mcmanus , @bobbrow :
And i still feel the "Go to Symbol in Workspace" even after caching feels a little unusable. Let me put you through one scenario.
Scenario 1 : I have a class ,say "Tree", which is defined in tree.cpp and i have another class, say "algoA", which has made Tree as a friend class in file algo.cpp . Now as a user when i use "Go to Symbol in Workspace" and search for "tree", my expectation is to go to the class definition of "tree" in tree.cpp. But the search shows tree symbol defined as friend in algo.cpp first. This is definitely making the functionality unusable. I strongly believe the tree in algo.cpp shouldn't appear as it is a usage and the reference list of the symbol should have it.

@sean-mcmanus
Copy link
Contributor

Yeah, the caching work could be done in the background on workspace loading instead of on first use, we just haven't implemented that yet (I think I mention this in #1686 ).

The behavior with friend declarations appearing in the symbol list is inherited from VS 2017, but in that case they show the results with different icons. We could potentially add some option to change this behavior, but we haven't had many requests for this yet. I've created an issue to track this request: #2369 .

image

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

3 participants