Language Server (LSP) not called for language features when used along with a Language Service
We have a Visual Studio extension that implements a custom code editor and a legacy Language Service.
- Code editor is opened using IVSUIShell.CreateDocumentWindow.
- Language Service is associated with this editor using Microsoft.VisualStudio.Editor.Implementation.TextDocData.SetLanguageServiceID
We also have a Language Server (LSP) implementation, that we are trying to use from this editor.
We have implemented a Language Client as in - https://learn.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2022
With this, only a few LSP messages are reaching the Language Server like - textDocument/didOpen, textDocument/didClose etc.
IntelliSense notifications like - textDocument/completion, textDocument/hover etc are not reaching the Language Server.
- Microsoft.VisualStudio.Package.LanguageService.GetLanguagePreferences() is overridden in my Language Service implementation and returns false for IntelliSense properties.
- Server capabilities returned from LSP - 'initialize' request correctly sets the IntelliSense features it supports.
This works correctly when the Language Server (LSP) is used with a local file (with the specified extension) - 'textDocument/completion' notification is received in LSP.
But when used with a code editor opened and a language service attached as described above, 'textDocument/completion' notification is not received in LSP server.
Any pointers on what could be the issue here will be greatly helpful.