We are trying to migrate a Visual Studio 2019 extension to Visual Studio 2022. Extension provides couple of features, but one feature that doesn't work is "HtmlCompletionProvider". We are using it to provide custom elements and attributes inside HTML editor in VS2019.
This is how our completion classes are defined.
[HtmlCompletionProvider("Children", "*")]
[ContentType("htmlx")]
[Name("DurandalElementsCompletionProvider")]
public class DurandalElementsCompletionProvider : IHtmlCompletionListProvider
Interface is defined in Microsoft.WebTools.Languages.Html.Editor assembly.
This interface allows us to plugin into exisitng VS2019 intellisense and provide additional entries.
What is correct way to do this inside Visual Studio 2022? There is no documentation that we can find just by googling.
Closest we came to an explanation is that new Visual Studio is using LanguageService defined in: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Web Tools\Languages\LanguageServers\Microsoft.WebTools.Languages.LanguageServer.Server.dll
We presume that old way of providing "HtmlCompletionProvider" is unsupported in VS2022.
Angular is using IHtmlCompletionListProvider for it's extension.
https://devblogs.microsoft.com/visualstudio/angular-language-service-for-visual-studio/
Code example how they are using IHTMLCompletionListProvider
They are basically using it as a proxy to call their LanguageService.
There is no Angular extension for VS2022 that I'm aware of (so we could take a look how it's done).
Kind regards, Goran Vukoja
We solved it.
We decompiled Microsoft.WebTools.Languages.Html.Editor.dll, to see how default HTMLCompletionListProvider is defined. You are supposed to use ContentType("html"), instead of ContentType("htmlx").
[HtmlCompletionProvider("Children", "*")]
[ContentType("html")]
[Name("DurandalElementsCompletionProvider")]
public class DurandalElementsCompletionProvider : IHtmlCompletionListProvider