-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add completion list filter options #1798
Comments
Based on what you've shared, this is expected. For screenshot #1, your compiler defines all of these symbols by default (note that "File: " does not show a file... we should probably make this more clear that the compiler defined the symbol). For screenshot #2, pthread.h is being pulled in by a dependency of iostream so it is actually available to you. |
@bobbrow Is there a way to tell clang or LSP not to pull these unnecessary headers. If I know I won't be be using symbols from these headers I don't want to have these superfluous completion candidates. |
The "unnecessary" headers/symbols might be needed for iostream to compile correctly. However, we could add an option to exclude completion results from compiler-based (or non-workspace?) sources in the global scope. This wouldn't really work for C where all the library functions are in the global scope, but for C++, you could still get completions for things in std. UPDATE: I moved part of the issue to #2387 . |
We talked internally about exposing a setting that would let you filter out the compiler's default defines. Excluding stuff coming from outside the workspace wouldn't work since we expect pretty much all of the system headers to live outside the workspace (e.g. STL). And if you're coding for Win32, pretty much everything in the WinSDK is in the global scope. We could also add a setting that turns off the fuzzy matching if users think that's too distracting. Combined with a setting to hide the default defines, I think that would clean up the autocomplete list for you significantly. What do you think? |
@sean-mcmanus @bobbrow Please let me know when you manage to implement that. |
This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog. |
Version 1.22.1 (1.22.1)
I erased all paths to headers from c_cpp_properties.json. Even then IntelliSense gives me a completion suggestions. You can note that I didn't also write any
#include
.When I write
#include<iostream>
then it gives me suggestion from headers I never included.Os: MacOS High Sierra
c_cpp_properties.json: https://paste.ofcode.org/kbzSrbhAbrdrwiAJp3hbkV
clang: Apple LLVM version 9.1.0 (clang-902.0.39.1)
The text was updated successfully, but these errors were encountered: