Community.VisualStudio.Toolkit icon indicating copy to clipboard operation
Community.VisualStudio.Toolkit copied to clipboard

Extending VS Search

Open RobertvanderHulst opened this issue 3 years ago • 6 comments

I have received a request from a customer to extend the search functionality in VS. At this moment when you search in all files, you get a snippet of the code where the item was found, the file name and line number. The customer would like to also see the name of the method or property where the code was found. We have a database of the members and file names and line numbers, so we could lookup the info and return the member name. But to do that we would have to add a column to the search results and we would have to be called from the search engine.

Does anybody know of a way to extend this search functionality, or have the name of the a ms contact that can help me with that ? I found a lot of IVSearch.. interfaces (IVsSearchProvider, IVsSearchQuery etc), but not a working example of how these should be used.

RobertvanderHulst avatar Sep 09 '22 20:09 RobertvanderHulst

I don't believe this is possible. Perhaps @gundermanc knows?

madskristensen avatar Sep 09 '22 20:09 madskristensen

Hi @RobertvanderHulst here are a few of the controls and their respective APIs.

@veler FYI

gundermanc avatar Sep 09 '22 21:09 gundermanc

@gundermanc Your examples assume we implement LSP. At this moment we have our own api for the editor. Maybe we should indeed switch to LSP, so we can support VS code too? I'll discuss that in the team. Do you know if LSP is also available for VS2019 (we have to support at least 2 versions of VS)? And do you know if there is an example VSIX that shows how LSP is implemented. Preferable in managed code and not Typescript?

RobertvanderHulst avatar Sep 20 '22 06:09 RobertvanderHulst

@madskristensen Have you considered LSP for your language extensions, such as tyep pkgdef support?

RobertvanderHulst avatar Sep 20 '22 06:09 RobertvanderHulst

I haven't looked at it yet. I think inevitably we'll have to support it. However, since it's a new API, I'm not sure it needs any wrapping by the toolkit

madskristensen avatar Sep 20 '22 16:09 madskristensen

Do you know if LSP is also available for VS2019 (we have to support at least 2 versions of VS)?

Yes, it should be supported in older builds of VS, though there may be some capabilities that only exist in the newer builds.

And do you know if there is an example VSIX that shows how LSP is implemented.

Here's an example: https://github.com/microsoft/VSSDK-Extensibility-Samples/tree/master/LanguageServerProtocol

gundermanc avatar Sep 20 '22 16:09 gundermanc