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

Exclusions aren't applied to the first directory found for each browse.path entry #10205

Closed
akhodeir opened this issue Nov 30, 2022 · 7 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@akhodeir
Copy link

akhodeir commented Nov 30, 2022

Environment

  • OS and Version: Mac OS
  • VS Code Version: 1.73.1
  • C/C++ Extension Version: Microsoft extensions (C/C++ and C/C++ extension back)
  • Other extensions you installed (and if the issue persists after disabling them): CodeLLDB
  • If using SSH remote, specify OS of remote machine: No
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Bug Summary and Steps to Reproduce

Bug Summary:
I created a workspace with many folder. Inside each folder there exists many files.

I build this settings.json:

{
"files.associations": {
"memory": "c",
"variant": "c"
},
"search.exclude": {
"/firmware": true,
"
/cellular" : true,
"/common":true,
"
/embedded_headers" : true,
"/output" : true,
"
/platform_sw":true,
},
"files.exclude": {
"/*.unt": true,
"
/*.c":false,
},
"C_Cpp.exclusionPolicy": "checkFilesAndFolders",
"C_Cpp.intelliSenseEngine": "Default",
}

the "search.exclude" entry contains all folder in the project.

Steps to reproduce:
see above.
I also reset the IntelliSense DB.

Expected behavior

When I reset IntelliSense DB, I still see its progress as multiple files. I expected no files to be included since all folders where added in the search exclude entry.

I expected that IntelliSense wouldn't find any function declaration, when I right click on a function and press "go to definition"

Code sample and Logs

c_cpp_properties.json doesn't exist in my project.

Screenshots

No response

Additional context

No response

@sean-mcmanus
Copy link
Contributor

Our extension doesn't look at the search.exclude feature, because we consider that setting to only apply to VS Code's search. You should set C_Cpp.files.exclude instead.

@michelleangela michelleangela changed the title IntelliSense exclude/include path IntelliSense exclude/include path (search.exclude) Nov 30, 2022
@akhodeir
Copy link
Author

akhodeir commented Dec 1, 2022

Thanks for the reply.
I added the entry to the settings.json

  "C_Cpp.files.exclude": {

        "**/firmware_pmu": true,
        "**/cellular" : true,
        "**/tools": true,
        "**/common":true,
        "**/embedded_headers" : true,
        "**/firmware_bb":true,
        "**/output" : true,
        "**/platform":true,
        "**/vinyl":true,        
        "**/.vscode": true,
        "**/.vs": true
  },
  "C_Cpp.codeAnalysis.exclude": {
        "**/firmware_pmu": true,
        "**/cellular" : true,
        "**/tools": true,
        "**/common":true,
        "**/embedded_headers" : true,
        "**/firmware_bb":true,
        "**/output" : true,
        "**/platform":true,
        "**/vinyl":true,        
        "**/.vscode": true,
        "**/.vs": true
  },

when I reset the intellisense database, I still see it discovering all files in the project. (all folders in the project are excluded for testing the extension)
IMG-3221

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 8, 2022

Can you set C_Cpp.loggingLevel to "Debug" and look at the "C/C++" logging to see which folder are being processed, e.g.

Discovering files...
  Processing folder (recursive): 

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Dec 8, 2022
@sean-mcmanus sean-mcmanus self-assigned this Dec 8, 2022
@akhodeir
Copy link
Author

akhodeir commented Dec 12, 2022

Thanks for the hints.

I enabled the debug mode. here is the output:

`
Processing folder (recursive): /Library/Developer/CommandLineTools/SDKs/******
Processing folder (recursive): /Library/Developer/CommandLineTools/SDKs/******
Discovering files: 41383 file(s) processed
0 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
Parsing: 0 files(s) processed
Done parsing remaining files.

`
Note: complete pathes are removed and "******" are used instead.

I tried to disable them via "C_Cpp.files.exclude" and "C_Cpp.codeAnalysis.exclude" ---> "/Library/Developer/CommandLineTools/SDKs/*":true
but they are still processed

@sean-mcmanus sean-mcmanus added bug and removed more info needed The issue report is not actionable in its current state by design labels Dec 20, 2022
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 20, 2022

It appears to be a bug. The files.exclude is not applied to the root folder if it's in the browse.path. You can work around this bug via setting "C_Cpp.exclusionPolicy": "checkFilesAndFolders" (that setting is not recommended after this bug is fixed though).

@sean-mcmanus sean-mcmanus added this to the 1.14.0 milestone Dec 20, 2022
@sean-mcmanus sean-mcmanus changed the title IntelliSense exclude/include path (search.exclude) Exclusions aren't applied to the first directory found for each browse.path entry Dec 20, 2022
@sean-mcmanus
Copy link
Contributor

But if you have "C_Cpp.exclusionPolicy": "checkFilesAndFolders" set already, then I'm not sure why the exclusion wouldn't be working (it works for me). You could potentially set "C_Cpp.loggingLevel": "8", temporarily to get more exclusion info.

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 4, 2023
@sean-mcmanus
Copy link
Contributor

The fix is available with 1.14.0 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.14.0

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
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 quick fix
Projects
None yet
Development

No branches or pull requests

2 participants