How to Extending vs2010 editor context menu for .js file?

前端 未结 1 640
广开言路
广开言路 2021-01-03 09:04

I have a VS2010 VSIP package with several commands,Those commands are added to the javascript editor\'s context menu,and i am using

  

        
1条回答
  •  醉梦人生
    2021-01-03 10:01

    The HTML/CSS/JS code editors actually show different context menus than the main code editor. Unfortunately, the Guid/ID pairs for these context menus aren't published or defined in the Visual Studio SDK.

    However, there is a debug hook (since VS 2005 SP1) that lets you identify the Guid/ID of almost any menu item you could be interested in. See this blog post for how to do that.

    Using the technique described in that post, if I CTRL+SHIFT+RIGHTCLICK in the Javascript editor, I get the following dialog:

    alt text

    In the section of my VSCT file, I can put the following:

    
        
    
    

    Then, it's just a matter of parenting to that Guid/ID:

      
        
      
    

    0 讨论(0)
提交回复
热议问题