How to use Language Server (LSP) with editors opened using IVSUIShell.CreateDocumentWindow

Sajith 11 Reputation points
2024-08-08T15:13:00.8066667+00:00

I have a Visual Studio extension that opens editors using IVSUIShell.CreateDocumentWindow.

I am now trying to use Language Server (LSP) for the editors from this extension -

https://learn.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2022

But on opening the editor, Language Client is not getting invoked. Is this because ContentType for the editor is not set? How to set ContentType for an editor opened using IVSUIShell.CreateDocumentWindow ?

Developer technologies Visual Studio Extensions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.