Le réseau pour les développeurs > Forums - Accueil > Visual Studio Extensibility > How to make my language service work in a split code window
Poser une questionPoser une question
 

TraitéeHow to make my language service work in a split code window

  • jeudi 21 août 2008 17:13ReggieAtSun Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    I have implemented a language service that seems to be working.  I'm connecting it to a standard code window.  The code window is editing objects from a db so it is not using files on disk.  All seems ok until I split the code window at which point the bottom pane is ok but the top pane seems not to paint at all.

    I then loaded up the regexlangservice sample that came with the vs 2005 sdk.  It paints top and bottom but the scrollbar on the top pane won't paint.

    Any ideas?
    •  

Réponses

  • mercredi 27 août 2008 17:43Aaron MartenMSFT, PropriétaireMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Hi Reggie,

    I've reproed the behavior you're describing in the RegExLangServ sample in the VS 2008 SDK. I'll track this down and post back here when I figure out what's going on.

    Sincerely,
    AaronM
    http://blogs.msdn.com/aaronmar

Toutes les réponses

  • mercredi 27 août 2008 17:43Aaron MartenMSFT, PropriétaireMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Hi Reggie,

    I've reproed the behavior you're describing in the RegExLangServ sample in the VS 2008 SDK. I'll track this down and post back here when I figure out what's going on.

    Sincerely,
    AaronM
    http://blogs.msdn.com/aaronmar
  • mercredi 10 septembre 2008 17:02Douglas Hodges _VS_MSFTMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Réponse proposéeA du code
    This is actually a bug with the RegEx Language Service sample.  The issue is that the sample does not register its language service under the following registry key:

     

    HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Languages\Language Services

     

    If you are running the sample in the experimental hive with /RANU switch specified then this key would be:

     

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0Exp\Configuration\Languages\Language Services

     

    The good news is that there is an existing attribute that does this registration (ProvideLanguageService), but this was not  used in the RegExLanguageService sample. The sample can be easily fixed by adding the following attribute in VsPkg.cs:

     

        // This attribute is used to register your language under "Language Services" and set the

        // defaults for your language's Tools-Options user preferences.

        [ProvideLanguageService(typeof(RegularExpressionLanguageService), "Regular Expression", 101, RequestStockColors=true)]

     

    This attribute has many optional parameters that let you set the various user preference options.

    One should also add a string resource with ID=101 and value “Regular Expression”.


    Visual Studio IDE Architect
  • jeudi 11 septembre 2008 14:36Bert Huijben Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    The "RequestStockColors=true" line in this example gave me the hint to resolve an issue I was looking for since August 2007.

    My language service registered with RequestStockColors=false but provided no colors of its own.


    This provided me with several resizing, redrawing and scrollbar issues I tried to work around. Adding RequestStockColors=true allowed me to remove all these workaround.

    Thanks!