Implement a language service using a managed package infrastructure

I followed the steps listed in the walkthrough ( http://msdn.microsoft.com/en-us/library/bb166360.aspx ) to implement and register LanguageService, and I just can't get it to work.

My package loads correctly, I can add functional menu items and parameter pages, but I can not open the files registered on my service. When I attach the debugger, I see that my VSPackage is being built, loaded, and its FDoIdle method is called twice. After that, the Visual Studio experimental session goes into the weeds and seems to get stuck in an endless loop. If I try to save the .txt file as my file type, the file will be saved correctly, but it will not load in Visual Studio, and I get an Object null exception.

I see my problem mentioned in this question: Visual Studio 2010 colourizers, intellisense and the rest. Where to begin!

The resolution does not seem to use the Framework Managed Package Framework and use the Manage Extensibility Framework instead. That's great and all, but I would love to know what I'm doing wrong with my MPF LanguageService implementation.

Has anyone successfully created a LanguageService using MPF? Can someone lead me to a working example or walkthrough?

THE PROBLEM IS SOLVED !:

I did another debugging and noticed that the experimental instance of Visual Studio was stuck, calling the following several times:

Microsoft.VisualStudio.Editor.Implementation.VsFontsAndColorsInformation.TryGetIndexForNativeItem (string name, IVsColorTable colorTable, Int32 & colorTableIndex)

RequestStockColors true ProvideLanguageServiceAttribute, . !

+3
1

!:

, Visual Studio , :

Microsoft.VisualStudio.Editor.Implementation.VsFontsAndColorsInformation.TryGetIndexForNativeItem( , IVsColorTable colorTable, Int32 & colorTableIndex)

RequestStockColors true ProvideLanguageServiceAttribute, . !

+6

Source: https://habr.com/ru/post/1796641/


All Articles