Author |
Topic |
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 26 2024 : 04:31:58 AM
|
Hello, It would be really beneficial to have a per-file property that allows to remove all intellisense parsing from it. Even better if this was available to do from a folder or filter, so that we could exclude all intellisense information of all contained files & folders.
Example: excluding a file from intellisense named my_shadows.cpp This file contains the function `bool isCastingShadows() const noexcept;` Now when I open the panel "Find Symbol" and search for `isCastingShadows` I shouldn't be able to find it.
Thanks.
PS. That's for C++. |
Edited by - KeyC0de on Aug 26 2024 04:36:55 AM |
|
foxmuldr
Tomato Guru
USA
425 Posts |
Posted - Aug 26 2024 : 08:14:42 AM
|
I'm not sure you could exclude Intellisense parsing through VAX, but you could have them exclude it in their own internal parser.
Microsoft did recently introduce a content exclusion feature for Copilot, one which allows settings to exclude certain source code files:
https://devblogs.microsoft.com/visualstudio/copilot-content-exclusion-in-visual-studio/
"This feature allows your admins to configure Copilot to ignore certain files in a repository or organization, giving you enterprise control that ensures sensitive information is protected while seamlessly integrating trusted AI for efficient coding..."
-- Rick C. Hodgin
|
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Aug 26 2024 : 08:30:53 AM
|
For VA, you need to turn On the setting:
VA Options -> Performance -> Do not parse files excluded by .vscode\settings.json (requires restart)
and make sure this file is present, in the folder that holds your SLN file, or in the root directory you are opening if you are opening a folder tree. The test file I use here with this setting enabled is:
{
"files.exclude": {
"*/cpp_dll_cpp17": true,
"cpp_dll_cpp20" : true,
"**/bugs" : true,
"**/code_formatting_tests/clangFormatBase" : true,
"**/test_plain_text.txt" : true,
"**/*.xaml" : true
}
} which tests excluding entire folders, and all of their content, also specific file extensions and file names.
The excluded directories are "cpp_dll_cpp17", "cpp_dll_cpp20", "bugs" and "code_formatting_tests/clangFormatBase"
Can you see what I am doing with this sample file? |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 26 2024 : 08:53:20 AM
|
I'll try to test this.
quote: Originally posted by feline .vscode\settings.json (requires restart)
Where is the location of the file .vscode\settings.json?
For the record, my question is for Visual Studio 2022, not visual studio code. |
Edited by - KeyC0de on Aug 26 2024 08:54:34 AM |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 26 2024 : 09:04:44 AM
|
I have created folder .vscode in the vs solution directory. I added a settings.json file in there. I want to exclude one directory, so I added this content inside the file:
{
"files.exclude":
{
"MyProject/MyFolder" : true
}
}
But it doesn't work. I can still see intellisense from content inside the files of this excluded directory. |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Aug 26 2024 : 09:59:21 AM
|
Despite the file name, this file is picked up and respected by both Visual Studio and Visual Assist.
Are you working with a SLN file or are you opening a folder? I just want to make sure that you have the file in the correct location. The file content looks good.
Have you turned On the VA setting:
VA Options -> Performance -> Do not parse files excluded by .vscode\settings.json (requires restart)
and have you restarted Visual Studio since creating and saving the file?
If you look in VA's Open File dialog, are any of the files from the excluded directory still showing, or are they filtered out? First we need to know if the filter is having any effect on the files VA lists, before moving on to think about intellisense. |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 26 2024 : 10:03:40 AM
|
I'm opening a solution in visual studio. The solution has one project. I have done the rest you said. I tried placing this file in a .vscode folder in both the solution directory and the project directory and it didn't work. The files in excluded directories as well as their symbols are not getting filtered out. |
Edited by - KeyC0de on Aug 26 2024 10:04:18 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Aug 26 2024 : 10:25:52 AM
|
Can you try creating a test project to see if you get the same problem there?
I am going to email you a simple test project I have set up to test this, just so we can test the same exclude rules and directory structure, so we know if this works at all for you. |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 26 2024 : 10:38:54 AM
|
Ok, sure, I'm waiting. |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Aug 26 2024 : 3:59:14 PM
|
I have emailed you:
case=164901 |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Aug 27 2024 : 02:49:21 AM
|
I have tested the provided project with no changes and it doesn't work at all. No files are excluded.
Let me give you version details. I'm not using latest VA version and my version expired some months ago. I have yet to renew.
VA_X64.dll file version 10.9.2476.0 built 2023.01.19 DevEnv.exe version 17.9.34607.119 Community
Could be a bug. Anyhow, thanks for the help. |
Edited by - KeyC0de on Aug 27 2024 02:49:59 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Aug 27 2024 : 08:42:36 AM
|
OK, that explains it. In VA 2476 this setting does work, but it ONLY works if you are opening a folder, not if you are opening a solution file. Since you are opening a solution file, can you not remove the files you don't want parsed from the solution, or make a separate, smaller solution for editing, and have the main solution compiled when doing a build?
VA 2507 added the ability to apply this setting when using a SLN file, and I was testing my test case on the current version, which has this ability. |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Sep 07 2024 : 11:44:03 AM
|
quote: Originally posted by feline Since you are opening a solution file, can you not remove the files you don't want parsed from the solution, or make a separate, smaller solution for editing, and have the main solution compiled when doing a build?
I'm sorry for the late reply. I'm not sure I understand. I am currently including (so not-removing) the files in the solution that I don't want parsed. Those are third party library files that I don't want to debug, or see references of, but I still want to exist in the solution for compilation. So I always compile the solution with this in mind and I can't get it to work. Is there something I'm misunderstanding? |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Sep 09 2024 : 08:32:51 AM
|
Do these 3rd party libraries need to be compiled as part of your solution? Or do you just need to tell the compiler where the header files are, and then link to any pre-compiled library files?
It sounds like you are including the 3rd party library as part of your solution, as if it was code you were editing and working on, rather than treating it as an external library you just use. |
zen is the art of being at one with the two'ness |
|
|
KeyC0de
Junior Member
19 Posts |
Posted - Sep 09 2024 : 08:39:35 AM
|
quote: Originally posted by feline
Do these 3rd party libraries need to be compiled as part of your solution? Or do you just need to tell the compiler where the header files are, and then link to any pre-compiled library files?
It sounds like you are including the 3rd party library as part of your solution, as if it was code you were editing and working on, rather than treating it as an external library you just use.
They are third party .h & .cpp files which need to be compiled. Some have separate libs/dlls too, but that's another thing. I guess I could include them in the project compile them once and then exclude them and only re-include them if I change any project properties. But it's tedious to do this.
Thanks for the help anyway. |
Edited by - KeyC0de on Sep 09 2024 08:40:19 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Sep 09 2024 : 12:21:51 PM
|
I was hoping it was a pre-compiled 3rd party library. If that was the case, it would just be a matter of making sure you used the external library include settings, so VA would know the included files were not part of the solution.
The latest version of VA will help to fix this problem, for what that's worth. |
zen is the art of being at one with the two'ness |
|
|
superzmy
Senior Member
China
26 Posts |
Posted - Nov 14 2024 : 02:49:02 AM
|
Assume there are directories: svn\root\Include, svn\root\utility, svn\root\ProjVersion001, ProjVersion002, ProjVersion003. Each ProjVersion00X directory might contain vsproj\xx.sln, vsproj\xx.vcproj, and src\abc.cpp. I often copy the entire ProjVersion001 directory as ProjVersion001_fixA, etc.
However, occasionally when I open one of the .sln files in Visual Studio and use VA Find Reference, I see cpp code symbols from other .sln directories, even if I havent opened a particular directory for a long time. Same name symbols were repeat shown in windows without file path, so that I had to move mouse on it to see tooltip. Lucky that I found Directory column in FindSymbol Window.
I have tried the JSON settings mentioned in posts, opened settings, and restarted, but I still cant ignore the symbols in sibling directories no matter what. I really want to block them. Below is the content of the JSON file:
{ "files.exclude": { "../../**": true, "../**": false, "D:/svn/root/ProjVersion001/**": true } |
Edited by - superzmy on Nov 14 2024 02:59:25 AM |
|
|
superzmy
Senior Member
China
26 Posts |
Posted - Nov 14 2024 : 02:52:12 AM
|
I want that VS Find Refferance Window/Find Symbol Window has a textbox of Path like VS find in files splited with ';'. so that I was sured to see symbols under the dirs. |
Edited by - superzmy on Nov 14 2024 02:53:08 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Nov 14 2024 : 10:20:01 AM
|
If you trigger a VA symbol database rebuild, via:
VA Options -> Performance -> Rebuild symbol databases
which requires an IDE restart to take effect, does this help? Or are you still seeing unwanted symbols?
I am trying to work out if these symbols are being remembered from a previous solution you have opened or not. |
zen is the art of being at one with the two'ness |
|
|
superzmy
Senior Member
China
26 Posts |
Posted - Nov 14 2024 : 11:02:48 PM
|
quote: Originally posted by feline
If you trigger a VA symbol database rebuild, via:
VA Options -> Performance -> Rebuild symbol databases
which requires an IDE restart to take effect, does this help? Or are you still seeing unwanted symbols?
I am trying to work out if these symbols are being remembered from a previous solution you have opened or not.
Yes Rebuild will work but the problem comes again and again. |
|
|
feline
Whole Tomato Software
United Kingdom
19054 Posts |
Posted - Nov 15 2024 : 06:57:09 AM
|
Does the problem come back again after opening a different solution? Or does it look like VA is managing to pick up the wrong files while still sticking to a single solution?
I suspect that when you copy the solution, VA isn't seeing it as a separate solution, so two "different" solutions are being merged in our symbol database. I don't know that's happening, so am trying to see if the pattern matches this theory. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|