Codist icon indicating copy to clipboard operation
Codist copied to clipboard

Syntax highlight for Find Reference and Search Result panel too?

Open fantasyz opened this issue 5 years ago • 10 comments

Colorizing the Find Reference and Search Result panel would greatly improve the experience on reading those search results.

Codist is a cool project. I am looking forward to future versions. Thank you.

P.S. sorry I don't know how to add tag to this issue. I want to tag it "Feature Request" like other people did but no luck finding the UI.

fantasyz avatar Dec 03 '18 00:12 fantasyz

Previously I used an extension named Codinion which had provided similar features as those you mentioned. However, I did not notice how helpful those features could be. And currently I could not find a way to intercept those windows. Do you know any open source projects which provide similar features?

wmjordan avatar Dec 04 '18 00:12 wmjordan

To me, when the a search return lots of results, additional coloring on class name and function name helps a lot.

Just Searched the market place, there isn't any open source project providing similar features. May be this is not so easy.

Searched the Microsoft site a little bit. These two maybe related: IFindAllReferencesWindow, IFindResultsWindow

https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.findallreferences.ifindallreferencesservice.startsearch?view=visualstudiosdk-2017#Microsoft_VisualStudio_Shell_FindAllReferences_IFindAllReferencesService_StartSearch_System_String_

https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.findresults.ifindresultsservice?view=visualstudiosdk-2017

The names of the interface sounds like related but the documentation doesn't say much about it. The Manager properties seems to be holding the search result.

This class is intended to manage data from multiple data sources, each of which can provide tens of thousands discrete entries. All methods on this interface can be called from either the main thread or a background thread.

(I am only guessing )

fantasyz avatar Dec 04 '18 01:12 fantasyz

I still could not figure it out. Thus the request had to be categorized as "backlog". But please don't feel down. Maybe something else will be developed in the future version.

wmjordan avatar Dec 05 '18 02:12 wmjordan

FWIW, my Menees VS Tools extension has a FindResultsClassifier.cs to highlight Find Results like this: FindResults

Also, the much more popular VSColorOutput extension has a FindResultsClassifier.cs to do something similar.

I stumbled across this issue because I was searching for an example use of IFindResultsWindow, which was mentioned above. But maybe this info will help you out.

menees avatar Apr 17 '20 23:04 menees

Thank you @menees. Your information did help.

In no time I developed some syntax highlight stuff into the Find Results' list view (it was no longer the default view in VS 2019 any more).

shot

However, the syntax highlight was for C# only at this moment and the advanced syntax highlight was not yet in effect.

wmjordan avatar Apr 18 '20 03:04 wmjordan

@fantasyz There's a new beta which partially implement this feature request now.

wmjordan avatar Apr 18 '20 07:04 wmjordan

Oh nice! Good to see this feature making progress. Thank you for both of you!

fantasyz avatar Apr 18 '20 08:04 fantasyz

It is quite weird that the highlight theme in the find results window does not match the document editor's, making the text very hard to read in the dark theme.

wmjordan avatar Apr 18 '20 09:04 wmjordan

Text windows with ContentType == FindResults have a completely different set of "Fonts and Colors" than text windows with ContentType == CSharp. See my FindResultsFormats.cs for how I added my own highlight colors for FindResults FileName, Match, and Detail (non-Match) text.

I don't know of any way to switch themes per line. For example, if I search for "bool", I might find hits in .cs, .cpp, .fs, and .ts files. There's no simple way to apply the language-specific themes, taggers, etc. to each of those lines. That'll take a ton of manual work, and there's no guarantee that those language-specific editor colors (from Code ContentType windows) will look good in FindResults windows.

menees avatar Apr 18 '20 13:04 menees

Thank you for your help. I partially figured it out by referencing the source code of VsColorOutput.

However, there's still some problems in the dark theme.

wmjordan avatar Apr 25 '20 03:04 wmjordan