Giter Site home page Giter Site logo

sublimedotnetconfig's Introduction

Sublime .NET Config

This package aims to provide better syntax highlighting of .config files that relate to .NET (i.e. C#) XML configuration. For example, it is common to use configuration transformations to automatically update config files for different environments. This makes it much easier to keep track of the differences between environments (dev, QA, production etc.). If you have the XPath 1.0 package installed, the syntax highlighting included in this package will highlight the XPath syntax in the xdt:Transform and xdt:Locator attributes, for convenience.

How it works

Syntax Highlighting

This package makes use of the YAMLMacros package to build a syntax definition based on the XML syntax definition, with a few extra features for .NET configuration files. This is the easiest way at the moment to extend or modify existing syntax definitions without needing to manually copy and paste the entire definition.

Due to the use of the embed feature, this package is only compatible with ST build 3156 or newer.

Configuration Transformation

Configuration Transformations require the .NET Core 2.0 SDK to be installed and available on the PATH. This functionality uses https://www.nuget.org/packages/Microsoft.DotNet.Xdt.Tools/ to perform the transformations. It can be a little slow the first time the build command is used, due to it needing to create a new project, download the package and build the project.

After the file has been transformed, it is automatically opened in ST, and acts just like any normal unsaved config file. As an added bonus, if you have https://packagecontrol.io/packages/IndentX installed, the file will be pretty-printed/indented after transformation.

Unit Tests

To run the unit tests, you will need to install https://packagecontrol.io/packages/UnitTesting, and then use the UnitTesting: Test Current Package entry in the command palette.

Planned features

Hopefully, in future, we can even get configuration transformation previews to show the original and transformed configuration files side by side with the differences highlighted... It may turn out to be useful to be able to turn the pretty-printing off via a preference, or to pretty-print the source file as well for comparison.

Autocompletion for known .NET configuration elements and attributes would also be cool.

It might also be useful to be able to create a transform file automatically from a source file and a target file, for cases where, for example, a Production config file has been altered by somebody with access to that environment, and you want to ensure your deployment script doesn't lose those changes, while also keeping them under source control. https://github.com/CameronWills/FatAntelope looks useful in this regard, but unfortunately targets the full .NET Framework.

sublimedotnetconfig's People

Contributors

keith-hall avatar

Watchers

 avatar  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.