|
|
|
|
|
|
|
VSX: Visual Studio Extensibility Architecture Part 2
Doug continued, bravely, into the late afternoon with details of the Visual Studio extensibility architecture.
It's not that I don't love COM, but what I want most after this deep dive is the moral equivalent for the managed developer.
Meme: There's a scenario for every extensibility point here.
Editors
- If you need to implement your own type of view, use the TextBuffer as your document data object, and then you can be open as the same time as the code editor. (If you don't want to be compatible with the code editor, don't implement the interfaces that it will query interface for.)
- A language service is a package that proffers a service that has a VSLanguageInfo and a colorizer interface. Again, to enable demand loading, you register for a file extension. VSLanguageInfo enables this broad range of features:
- Text colorization [see colorizer]
- Statement completion
- Method tips
- Special and red "squiggly" markers [marker client]
- Custom commands
- Context menus
- Hidden text (including concealed and expand/collapse)
- Code window dropdown bar [code window manager]
- Whether you are a full language service or not, one of the most general extension points is a TextView filter, where you can insert a handler into a chain to handle each key. The debugger does this to enable Run to cursor.
Project
- Provides the context for operating on a set of items as a unit.
- Solutions are thin containers around projects, but can express project build dependencies. A *.sln is shared across team members; a *.suo is per user and stores breakpoints.
- Coordinate RAD experience: opening, editing, and saving of files; source control (are dependent files checked out as a unit) [IVsSccProject2]; build (is there one, and what does it do) [IVsBuildableProjectCfg]; deployment (say to embedded device, SQL instance); debugging [IVsDebuggableProjectCfg].
- Other project examples: set up and deployment projects, and database project.
Hierarchies
- Projects are a kind of hierarchy (IVsHierarchy)
- Hierarchies generally manage sets of related items; documents are associated with a hierarchy-item ID pair.
- Hierarchies have many (optional) properties that are used for display and navigation.
- Other solution-related hierarchies include class view, resource view, performance explorer, test explorer, &c.
- Non-solution-related hierarchies include server explorer (i.e., SQL), team explorer (VSTS).
- Projects can be nested, e.g., VS 2003 had an Enterprise Template Project (ETP) which aggregated other projects and coordinated an enterprise solution with UI, data, and server tiers with projects within each. Solution folders have grown up to support this scenario, and they themselves are projects that can nest other projects.
- Project subtypes are a technique (using COM aggregation) to create a subtype of another project, e.g., WPF Project Flavor VB Basic Templates, or device VB templates (which provide deployment behavior where a normal VB project would have none).
Selection
- Of project, and of item within project.
- Each window manages its own selection context, including active hierarchy-item ID pair.
- Selection controls what is shown in Properties window &c. You can access the active selection using IVsMonitorSelection.
- Interacts with delayed loading because a selection can turn on a mode.
http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=vsxconf&DownloadId=3140
Posted
Sep 16 2008, 03:48 AM
by
jeffrey-schlimmer
|
|
|
|
|
|