Author |
Topic ![Next Topic Next Topic](icon_go_right.png) |
|
schoenherr
Tomato Guru
![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif)
Germany
160 Posts |
Posted - Dec 05 2019 : 06:45:29 AM
|
visual assist, eg."Open File In Solution" seems to ignore excluded items. I specified to exclude *.o files in VSWorkspaceSettings.json but VAX still offers to open these files. |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - Dec 05 2019 : 07:42:55 AM
|
Which IDE are you using?
How are you opening your folder / solution? I have never heard of the "VSWorkspaceSettings.json" file before, so I am reading up on it now. Is this automatically read if it exists and you simply open a folder in the IDE?
I would not expect VA to list .o files normally, since these are not going to be code files.
For now, can you please make sure you are looking at VA's Open File in Solution dialog, now right click on the dialog and turn On:
Open File in Solution dialog -> Right Click -> Apply persistent filter
this will show a filter field where you can add the rule:
-.o
which will tell VA to filter out all files ending with .o from the list. The persistent filter is always applied, even when the field is not showing. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - Dec 05 2019 : 10:03:11 AM
|
Can you explain what you are doing, and how you are doing it? As far as I can tell this file is only checked, if it is checked at all, in Visual Studio Code, which is a different IDE to Visual Studio, which is what VA supports:
https://stackoverflow.com/questions/30140112/how-do-i-hide-certain-files-from-the-sidebar-in-visual-studio-code
Using VS2019 I have a folder that I am opening, and in the root of this folder I have created a VSWorkspaceSettings.json file, which now contains:
"files.exclude": { "**/.o": true }
but this has no effect on the files that are listed in Solution Explorer after opening the folder. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
sean
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
USA
2817 Posts |
Posted - Dec 05 2019 : 10:29:32 AM
|
VA does not read that file, but does use the VS Workspace API.
According to this github issue, VSWorkspaceSettings.json is not supposed to be user editable: https://github.com/MicrosoftDocs/visualstudio-docs/pull/3499
An additional workaround might be to add .o to: Tools | Options | Projects and Solutions | VC++ Project Settings | Extensions to Hide
VA does honor that list when "Include all files in solution directories" is enabled -- but it might not take effect if the VS Workspace API exposes the .o files. |
Edited by - sean on Dec 05 2019 10:32:03 AM |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
schoenherr
Tomato Guru
![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif)
Germany
160 Posts |
Posted - Dec 16 2019 : 06:29:21 AM
|
Hi sorry for the long delay.
I'm using VisualStudio2019 - "Open Folder". And according to "https://docs.microsoft.com/de-de/visualstudio/extensibility/workspaces?view=vs-2019" I placed an VSWorkspaceSettings.json in my local AppData directory for visual studio "C:\Users\...\AppData\Local\Microsoft\VisualStudio\16.0_ba92ef64\OpenFolder" which will be used as most non specific settings file.
this file contains somthing like ... "ExcludedItems": [ ".git", ".vs/", ".vscode", "*.a", ".cmake.state", "*.o", "*.updt", "*.dat", "*.bak", "Makefile.*" ], ...
and this is obviously used by VisualStudio2019 to determine the content of the "OpenFolder-Workspace" the suggested workaround "Extension to hide" does not seem to work. |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - Dec 16 2019 : 2:10:22 PM
|
OK, thank you for the clear description. Now I am seeing these files being filtered out of the Solution Explorer view of the folder.
If you go to VA's Open File in Solution dialog, right click and select "Display edit control for persistent filter" a second filter field will be shown. If you now set this field to be:
-.o
this will stop VA from listing any of these .o files in this dialog, so you don't have to work around them. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
sean
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
USA
2817 Posts |
Posted - Dec 16 2019 : 2:35:38 PM
|
Thanks for the follow-up. I've opened case=141644 to address the issue. |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
schoenherr
Tomato Guru
![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif) ![](icon_star_green.gif)
Germany
160 Posts |
Posted - Dec 17 2019 : 03:07:08 AM
|
Thanks for addressing the issue, the persistent filter workaround works :-) |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
Annihilus
New Member
![](icon_star_green.gif)
3 Posts |
Posted - May 28 2024 : 10:47:45 AM
|
So... 4 years later and VA still ignores VSWorkspaceSettings.json? What's the status of case=141644? |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - May 28 2024 : 12:18:46 PM
|
We were advised by Microsoft that we should be looking at, and using the .vscode\settings.json file instead, which we have supported for a while now.
Support is enabled by the setting:
VA Options -> Performance -> Do not parse files excluded by .vscode\settings.json (requires restart)
This is a sample settings.json file, that I use for testing this, which excludes both directories and specific files:
{
"files.exclude": {
"*/cpp_dll_cpp17": true,
"cpp_dll_cpp20" : true,
"**/bugs" : true,
"**/code_formatting_tests/clangFormatBase" : true,
"**/test_plain_text.txt" : true,
"**/*.xaml" : true
}
}
|
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
Annihilus
New Member
![](icon_star_green.gif)
3 Posts |
Posted - May 28 2024 : 1:05:56 PM
|
Thanks for the quick response, feline!
But I am super confused that MS would recommend using a vscode setting in vs. I still need the VSWorkspaceSettings.json to filter the project workspace itself, so having a separate .vscode\settings.json would be completely redundant. This is a weird concept, to be honest.
Anyway, I tried it and it doesn't seem to work properly. According to the documentation I found, a key like "**/bugs" should filter out *any* directory called "bugs" in the workspace, but apparently it only works on the root directory. Same for the "**/*.xaml" example, I still see all those crap files in the Open File in Solution dialog.
On the other hand, using a persistent filter seems to do a much better job at what I want, but it's actually *not* persistent across sessions. It's quite a mess. It shouldn't be that hard to define an ignore list. |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - May 29 2024 : 07:51:32 AM
|
Personally I don't understand the recommendation from Microsoft to use the .vscode\settings.json either, but this was what we have told, so it is what we went with, in the hopes of avoiding to much disruption when the supported files change down the line.
For the exclusion rules though, I am using the above file, and for me, the "**/bugs" entry is filtering out the following directories, and all of their content:
entry == "**/bugs" : true, is excluding the directory == \src\ManualVaTests\bugsis excluding the directory == \src\ManualVaTests\ManualVaTests_VS2017\c_sharp_class_library\Bugsis excluding the directory == \src\ManualVaTests\ManualVaTests_VS2017\c_sharp_class_library2\Bugsis excluding the directory == \src\ManualVaTests\ManualVaTests_VS2017\cpp_clr_class_library\bugs have you restarted the IDE to make sure this setting is taking effect?
What persistent filter are you talking about? There is a persistent filter available in VA's Open File in Solution dialog, but that is persistent for me. I have just double checked, and yes, persistent across IDE restart as well. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
Annihilus
New Member
![](icon_star_green.gif)
3 Posts |
Posted - May 29 2024 : 08:59:59 AM
|
Hi again.
For context: We are transitioning from a VS Project (.sln and .vcxproj files) to a cmake based project. So I'm opening the entire project folder in VS now, and there is an extensive LIBRARIES subfolder in there which I want to be ignored both by the IDE as well as VA. (There are more folders that I'd like to be excluded, including nested ones, but LIBRARIES is the most problematic one, so let's focus on that).
As already mentioned, creating a VSWorkspaceSettings.json takes care of the IDE, but not VA. There are two main problems: 1. When I open the project folder, VA takes ages to "create instance of template xyz". Most of these templates are only used within LIBRARIES. 2. When I use the Open file in Solution dialog, it shows me a lot of stuff that I don't want to see.
So I created a .vscode\settings.json as you suggested:
{
"files.exclude": {
"**/LIBRARIES": true
}
}
After activation of the checkbox "Do not parse files excluded by .vscode\settings.json" and a restart of the IDE, this is the effect: 1. Scanning seems entirely unaffected. Still takes ages, still creates all of those template instances. 2. Open File in Solution dialog shows significantly fewer files from the LIBRARIES folder... but some are still there, so I have no clue what's going on.
I tried solving at least the second problem by using a Persistent Filter, but it's gone after an IDE restart. |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - May 29 2024 : 12:53:27 PM
|
I have just double checked, and this setting worked with CMake projects, so no SLN file, long before it worked when opening a solution file. So the fact that you are moving over to CMake really should not matter, and excluding the library directory tree is exactly the sort of situation this setting is designed for, and works correctly for for me.
For the persistent filter, are you working with more than one copy of Visual Studio open? Any problems with the IDE crashing? I ask because VA's settings are saved on exit, so if have two copies of the IDE open, the last IDE instance to be closed will save out its settings last, possibly overriding settings you set in the first instance.
Is your forum email address good to send you test files to? I am going to look out and edit one of my test cases for excluding files and directories and send it to you, so we can try testing the same thing, to compare results. Having to configure two files is definitely unhelpful, but VA does ignore the excluded directories for me, so I don't know why this is failing for you. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
feline
Whole Tomato Software
![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif) ![](icon_star_red.gif)
United Kingdom
18915 Posts |
Posted - May 30 2024 : 12:53:19 PM
|
I have emailed you:
case=164592
Also, just creating the .vscode\settings.json file on its own is enough for VS2022 on my system to exclude both LIBRARIES directories from the Solution Explorer window. So I don't know why you are getting such different results. Hopefully the test solution I have sent will help. |
zen is the art of being at one with the two'ness |
![Go to Top of Page Go to Top of Page](icon_go_up.png) |
|
|
Topic ![Next Topic Next Topic](icon_go_right.png) |
|