Your editor extension classes inherit from ExtensionPart. Make sure to convert any backslash to slash when creating the glob pattern. to match on example.a, example.b, but not example.0)Ī backslash ( \) isn't valid within a glob pattern. to negate a range of characters to match in a path segment (for example, example.to declare a range of characters to match in a path segment (for example, example.Then, implement the TextViewExtensionConfiguration property, as required by ITextViewChangedListener and ITextViewOpenClosedListener, making the listener apply when editing C# files: public TextViewExtensionConfiguration TextViewExtensionConfiguration => new()ĪppliesTo = new matches all TypeScript and JavaScript files) ITextViewOpenClosedListener, or both, and add a attribute. Then, create a new class, implementing the ExtensionPart base class and ITextViewChangedListener, Together, these listeners can be used to observe the open, close, and modification of text editors. There are two types of listeners, ITextViewChangedListener, and ITextViewOpenClosedListener. The editor service object is an instance of the EditorExtensibility class, which exposes real-time editor functionality, such as performing text edits.Ĭommands are initiated by the user by clicking on an item, which you can place on a menu, context menu, or toolbar. When an editor window is opened or closed, TextViewOpened and TextViewClosed events occur. For example, when a user types something into the editor, a TextViewChanged event occurs. Editor extensibility currently supports three entry points: listeners, the EditorExtensibility service object, and commands.Įvent listeners get triggered when certain actions occur in an editor window, represented in code by a TextView. Your extension code can be configured to run in response to various entry points (situations that occur when a user interacts with Visual Studio). The editor object model is described at Editor concepts. Individual files may be opened for editing, and the open editor window is referred to as a TextView. The Visual Studio editor generally refers to the functionality of editing text files, known as documents, of any type. Extending text views with new text view margins.Performing text edits and selection/caret changes.Reading the text of the document and the selections/carets locations.Listening for text view (editor) state changes.Listening for text views being opened and closed.Examples include extensions that insert and modify code in an existing language.įor the initial release of the new Visual Studio extensibility model, only the following capabilities are supported: The Visual Studio editor supports extensions that add to its capabilities.
0 Comments
Leave a Reply. |