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

Add completion list filter options #1798

Closed
Miszo97 opened this issue Apr 7, 2018 · 6 comments
Closed

Add completion list filter options #1798

Miszo97 opened this issue Apr 7, 2018 · 6 comments
Labels
Feature: Auto-complete Feature Request Language Service more votes needed Issues that have been postponed until more community members upvote it
Milestone

Comments

@Miszo97
Copy link

Miszo97 commented Apr 7, 2018

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.

screen shot 2018-04-07 at 20 41 09

When I write #include<iostream> then it gives me suggestion from headers I never included.

screen shot 2018-04-07 at 20 41 59

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)

@bobbrow
Copy link
Member

bobbrow commented Apr 9, 2018

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 bobbrow changed the title IntelliSense gives unwanted completions from unwanted/not included headers. detail text for preprocessor symbols should not say "File: " Apr 9, 2018
@bobbrow bobbrow changed the title detail text for preprocessor symbols should not say "File: " detail text for preprocessor symbols defined by the compiler should not say "File: " Apr 9, 2018
@Miszo97
Copy link
Author

Miszo97 commented Apr 10, 2018

@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.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 10, 2018

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 .

@bobbrow
Copy link
Member

bobbrow commented Apr 11, 2018

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?

@Miszo97
Copy link
Author

Miszo97 commented Apr 13, 2018

@sean-mcmanus @bobbrow Please let me know when you manage to implement that.

@sean-mcmanus sean-mcmanus changed the title detail text for preprocessor symbols defined by the compiler should not say "File: " IntelliSense gives unwanted completions from unwanted/not included headers Aug 11, 2018
@bobbrow bobbrow changed the title IntelliSense gives unwanted completions from unwanted/not included headers Add completion list filter options Nov 14, 2019
@bobbrow bobbrow added this to the Backlog milestone Nov 14, 2019
@Colengms Colengms modified the milestones: Backlog, Triage Apr 8, 2021
@github-actions
Copy link

github-actions bot commented Jun 7, 2021

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

@github-actions github-actions bot added the more votes needed Issues that have been postponed until more community members upvote it label Jun 7, 2021
@github-actions github-actions bot closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Auto-complete Feature Request Language Service more votes needed Issues that have been postponed until more community members upvote it
Projects
None yet
Development

No branches or pull requests

4 participants