Giter Club home page Giter Club logo

editorutils's Introduction

Editor Utilities Library

This is a utility library to be used with VSIX projects. It abstracts away many of the problem areas of the Visual Studio API into simple to use types.

This project is available as a set of NuGet packages. Which one to choose depends on which version of Visual Studio you are targetting

  • EditorUtils: VS 2010 and above
  • EditorUtils2012: VS 2012 and above
  • EditorUtils2013: VS 2013 and above

If you don't target VS 2010 then use EditorUtils2012 instead of EditorUtils. This avoids some tooling issues in the Visual Studio build around missing references

AppVeyor: Build status

Features

EditorUtils is a collection of abstractions for building VSIX projects. It is broken down into the following feature areas

Tagging

Syntax highlighting, brace completion, intra text adornments, etc ... are all features provided by the ITagger interface. The interface is simple enough but the rules and scenarios around this interface are complex and largely undocumented. EditorUtils abstracts away much of this complexity by providing a much simpler interface IBasicTaggerSource.

Async Tagging

All ITagger implementations are driven through the UI thread of Visual Studio. Any delay in tagger implementations is felt immediately by the user. Simple taggers can afford to be synchronous but more complex taggers must be asynchronous in order to keep the UI responsive. EditorUtils provides the IAsyncTaggerSource<TData, TTag>to abstract away all of the complexities of async tagging.

class MyAsyncTaggerSource : IAsyncTaggerSource<string, TextMarkerTag> { ... } 

MyAsyncTaggerSource myAsyncTaggerSource = new MyAsyncTaggerSource();
ITagger<TextMarkerTag> tagger = EditorUtilsFactory.CreateAsyncTaggerRaw(myAsyncTaggerSource);

Editor Hosting

At its core the Visual Studio editor is just a WPF control that is completely independent of Visual Studio itself. The ability to host this control outside of Visual Studio is critical to thorough testing of VSIX plugins. EditorUtils makes this extremely easy to do with the EditorHost feature.

var editorHost = new EditorHost();
var textView = editorHost.CreateTextView(); 

editorutils's People

Contributors

jaredpar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.