Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Visual studio 2012 sdk, implementing navigation bar for personnal language in the editor

$
0
0

Hello fellow developers, I'm trying to implement navigationBar in my editor for my company private language... Actually I did it work when one editor is open, both navigation bar, types & members, are fully complete. But when I want to open a second file in VS both navigation bar of the new file are empty. Following the msdn "TypeAndMemberDropDownBar Class" page  I have :

My own language service class implementing the override CreateDropDownHelper

classGoldLanguageService:LanguageService{publicoverrideTypeAndMemberDropdownBarsCreateDropDownHelper(IVsTextView forView){GoldNavigationBars navigationBars =newGoldNavigationBars(this);return navigationBars;}

My TypeAndMemberDropdownBars class:

publicclassGoldNavigationBars:TypeAndMemberDropdownBars{publicoverride bool OnSynchronizeDropdowns(LanguageService languageService,IVsTextView textView,int caretLine,int caretCol,ArrayList dropDownTypes,ArrayList dropDownMembers,refint selectedType,refint selectedMember){//my stuff to fill dropDownTypes & dropDownMembersreturntrue;}

The point is : when I open a first file in my VS using my extension, I can see with the debugger VS calling correctly CreateDropDownHelper and then OnSynchronizeDropdowns, but when I open a second file, VS is calling CreateDropDownHelper as well, but it will never go into OnSynchronyzeDropDowns.

When I move in the first file, the OnSynchronyzeDropDowns method is call as well, and like you can imagine, never in the second.

The fist time in CreateDropDownHelper, if I try to call the LanguageService.GetSource(forView) I get in return a correct Source object, ben if I try this as well the second time, it will return a null Source. It sound like the IVsTextView pass in parameter the second in not good at all, but how VS can fail like this, did I miss something ?

Regards.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>