What is the application pattern for tool windows that rely on the Editor's tag content? RRS feed

  • Question

  • Hiya, 


    I'm new to Visual Studio Extensibility and I'm trying to build a vsix solution that is a bit like the Source Outliner PowerToy. Basically an ITagger parses the Editor for custom tags that describe the code structure of the the file. I want a tool window then to be able to tell me various things about the ITag content of the active Editor. For instance, I might want to display how many public methods there are in the active document. My ITag implementations detail public methods and I want to be able to count the appropriate ITags in the editor. 

    What I'm trying to work out is how to get access to the editor tag content from the tool window. Can anyone give me some pointers on this? Are there any samples that do this sort of thing using the VS 2010 model (I've found lots which demonstrate editor customization, but none which detail how to 'talk' to the editor from tool windows)?






    Monday, May 3, 2010 12:06 PM

All replies

  •  Hello, Steve

    Thanks for your post.

    Do you want to get the class structure like what the Source Outliner PowerToy does? Because you say “i might want to display how many public methods there are in the active document. IF you want to do this, Tag is not proper here, because it is marker that is associated with a span of text. You need use to CodeModel, to discover the active document class structure, see this.

    Discovering Code by Using the Code Model (Visual C#)

    You could use WindowEvents Object when the current active window changed.

    If it is not what you want, do you mean you want to get all the ITagger object in your tool window?



    Wednesday, May 5, 2010 8:39 AM