-
Notifications
You must be signed in to change notification settings - Fork 1k
New Editor API Guide
Starting from the 8.0 release Visual Studio for Mac introduces a new text editor engine and UI, the same that is used by Visual Studio. The benefits of sharing the editor between Visual Studio and Visual Studio for Mac is that code targeting the Visual Studio editor can run on Visual Studio for Mac with almost no changes required.
See details about the New Editor in the announcement here: https://aka.ms/vs/mac/editor/learn-more
This guide is aimed at Visual Studio for Mac extenders and addin authors, and will collect information and tips on how to take advantage of the New Editor and its API.
https://docs.microsoft.com/en-us/visualstudio/extensibility/inside-the-editor?view=vs-2017
The primary concepts that you need to be familiar with is an ITextBuffer and ITextView. An ITextBuffer is an in-memory representation of text that can be changed over time. At any given point in time the CurrentSnapshot property on ITextBuffer returns an immutable representation of the current contents of the buffer, an instance of ITextSnapshot. When an edit is made on the buffer, the CurrentSnapshot property is updated to the latest version. Analyzers can inspect the text snapshot on any thread and its contents is guaranteed to never change.
An ITextView is the UI representation of how ITextBuffer is rendered on screen in the editor control. It has a reference to its text buffer, as well as Caret, Selection and other UI related concepts.
Bulding and Running
Writing Add-ins
MonoDevelop API
MonoDevelop Design and Architecure
- The Project Model
- Error and Exception Handling
- The Command System
- The Service Model
- The Document/View Model
MonoDevelop Coding Guides