SpecFlow.VisualStudio icon indicating copy to clipboard operation
SpecFlow.VisualStudio copied to clipboard

[Feature] Add support for the Language Server Protocol to simplify integration with IDE's

Open ChristopherHaws opened this issue 7 years ago • 4 comments
trafficstars

I think we should investigate the possibility of implementing a SpecFlow LSP server to ease IDE integration. Many IDE's (https://microsoft.github.io/language-server-protocol/implementors/tools/) have native support for LSP already which means less work for us if we want to support all of those IDE's.

https://microsoft.github.io/language-server-protocol/ https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension

I haven't looked too much into this, but I think that LSP would enable a features I have been wanting for a while:

  • Reference support: View how many feature files reference a step and their location, directly from the C# step definition.
  • Step Documentation: Add XML docs to a step definition and see it in the feature file when hovering over the step.

ChristopherHaws avatar May 28 '18 17:05 ChristopherHaws

Yes, LSP is the future for IDE integrations. But writing a new IDE extension is a lot of work, where we really need contributions from the community.

SabotageAndi avatar May 29 '18 07:05 SabotageAndi

@SabotageAndi I've been thinking on creating a Language Server for Gherkin which implements LSP, basic features should be relatively easy by using same parser/compiler as SpecFlow is using (https://github.com/cucumber/gherkin-dotnet). By utilising the OmniSharp LSP extensions (https://github.com/OmniSharp/csharp-language-server-protocol) the language server can easily be written in C#.

Then the problem. How to wire the Language Server up with the SpecFlow tooling? I think your expertise is needed here.

bjorkstromm avatar Dec 05 '18 12:12 bjorkstromm

@mholo65 you don't want to hook an lsp into the existing code of the IntelliSense. A collegue of mine, @Christoph-Majcen, is working on a LSP based Extension for his master thesis. Have a look at it here: https://github.com/techtalk/SpecFlow.ideextension

SabotageAndi avatar Dec 05 '18 13:12 SabotageAndi

Cool! I see that you are using the OmniSharp extensions. I've created a small blog post on getting started with it here. In case you have any questions regarding the library, don't hesitate to ask. Also, feel free to join OmniSharp slack #lsp channel to join the discussion.

bjorkstromm avatar Dec 05 '18 13:12 bjorkstromm