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

Exclude System Included symbols/variables from autocomplete #5867

Closed
Richhoef opened this issue Jul 30, 2020 · 3 comments
Closed

Exclude System Included symbols/variables from autocomplete #5867

Richhoef opened this issue Jul 30, 2020 · 3 comments

Comments

@Richhoef
Copy link

Type: LanguageService

Is it possible to exclude the symbols/variables/etc which are found by the systemIncludePath from the auto complete?
I only want symbols/variables which are found in the files under the includePath and/or the browse.path to be suggested to me when I type. Now, the first things that are suggested are always many many variables which I have never used and probably will never use. Only when I type more characters, the list will become relevant.
I can get the desired behaviour by setting the C_Cpp.default.systemIncludePath to "C_Cpp.default.systemIncludePath": [""], (and not including those path's as includePath in the c_cpp_properties.json), but this has the, logical, (side) effect of intellisense not being able to find some of the files that are being included. If a variable found by the 'systemIncludePath' is used somewhere in the file, it obviously is being used and would be allowed to be suggested. This would make typing so much faster and nicer!

Reading customize default settings cpp #system-includes I thought the desired behaviour described above would already (supposed to) be the case, but I do not get it to work. Help is very much appreciated.

If more informating is needed, I would be happy to provide it!

Besides the above, it would also be nice to have variables that are used recently at/near the top of the list (depending on how often they are used recently). This would also speed up typing a lot.

Version info

  • OS and Version: Microsoft Windows [Version 10.0.18363.959]
  • VS Code Version: 1.47.3
  • C/C++ Extension Version: 0.29.0
@sean-mcmanus
Copy link
Contributor

Yeah, we'd have to add completion filtering based on the file path, possibly checking files.exclude or some other new setting.

@bobbrow
Copy link
Member

bobbrow commented Aug 6, 2020

This feels like too big of a hammer to solve the problem. I think that #1798/#4939 would address the root cause of the issue (too much info) and make the completion list more manageable. I wouldn't think that you'd really want to remove completions for all STL types (which is what I assume are the types of files pointed to by your systemIncludePath.

(And as an aside, if it is the standard C/C++ headers you're specifying in systemIncludePath, consider using compilerPath instead. You will get better IntelliSense.)

@bobbrow
Copy link
Member

bobbrow commented Aug 13, 2020

We'll close this as a duplicate of 1798 and 4939.

@bobbrow bobbrow closed this as completed Aug 13, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants