Hide classes in structural navigation

Answered

I tried to find a similar post, but could not find one.

I have quite a few dummy implementation of interfaces for unit testing purposes.

I would like to "hide' these classes from the "go to implementation" menus (or Ctrl-Alt-Click shortcut) and symbol search.

Is there a way to do this?

Using "stop index" works well for full-text search, but not for the structural navigation.

Adding [EditorBrowsable(Never)] has no effect, either.

0
8 comments

Hello, have you tried adding these files to elements to skip in Preferences | Editor | Inspection Settings?

0

Yes, I have (although I had forgotten about it :-)). The files in this directory show up with the OFF marker in top-right corner of the editor window, but "Go to implementation" does not ignore them.

0

Another option that can help is to exclude files from the project with right-click on it in Solution Explorer and click on Exclude. This will exclude the file from project model. You will be able to see it if click with Show All Files option anyway. Since you mentioned that those files are dummy test files that shoud not break the code. But this will hide them from functions like Go to Implementation. Is that an option for you?

0

This is exactly what I am looking for, i.e. not have the dummy class in 'Go to implementation'

My assumption about 'Exclude' was that it would exclude the file from the project itself, i.e. not compile at all.

Anyway, thanks a lot

0

It does exclude it from the project itself, it adds the following into csproj file:

0

I see. I was confused, because, for an embedded resource (included by a wild card), the 'exclude' menu option hides the file from the solution explorer (if 'show all' is not active), but does not change the csproj, so it looks like the file is no longer part of the build, but it still is.

Anyway, for a source file, it does not suit my needs, as I need the file to be built (needed by unit test projects).

0

Okay, I see. Then I have created an issue for adding such an option, please upvote and watch for monitoring the progress on it: RSRP-487888

0

Please sign in to leave a comment.