Community.VisualStudio.Toolkit
Community.VisualStudio.Toolkit copied to clipboard
Extending VS Search
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.
I don't believe this is possible. Perhaps @gundermanc knows?
Hi @RobertvanderHulst here are a few of the controls and their respective APIs.
-
Go to - You can use the C# API or the Language Server protocol message

-
VS Search control - Currently only extensible through the language server protocol message.

@veler FYI
@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?
@madskristensen Have you considered LSP for your language extensions, such as tyep pkgdef support?
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
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