All Projects → Elders → Vse Formatdocumentonsave

Elders / Vse Formatdocumentonsave

Licence: apache-2.0
Visual Studio - Format Document on Save

Projects that are alternatives of or similar to Vse Formatdocumentonsave

Sublime-uroboroSQL-formatter
Beautiful SQL Formatter for Sublime Text 3
Stars: ✭ 25 (-59.02%)
Mutual labels:  formatter, formatting
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-77.05%)
Mutual labels:  formatter, formatting
idea-uroborosql-formatter
Beautiful SQL Formatter for IntelliJ Platform
Stars: ✭ 18 (-70.49%)
Mutual labels:  formatter, formatting
Editorconfig Netbeans
A NetBeans IDE plugin supporting the EditorConfig standard. ⛺
Stars: ✭ 123 (+101.64%)
Mutual labels:  formatter, formatting
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-72.13%)
Mutual labels:  formatter, formatting
Nginx Config Formatter
nginx config file formatter/beautifier written in Python.
Stars: ✭ 222 (+263.93%)
Mutual labels:  formatter, formatting
laravel-formatters
«‎Formatter» pattern for Laravel
Stars: ✭ 86 (+40.98%)
Mutual labels:  formatter, formatting
Juliaformatter.jl
An opinionated code formatter for Julia. Plot twist - the opinion is your own.
Stars: ✭ 217 (+255.74%)
Mutual labels:  formatter, formatting
AutoFormatInputWatcher
This repository contains input watcher for auto formatting digits in edit text
Stars: ✭ 15 (-75.41%)
Mutual labels:  formatter, formatting
ufmt
Safe, atomic formatting with black and µsort
Stars: ✭ 46 (-24.59%)
Mutual labels:  formatter, formatting
awesome-python-code-formatters
A curated list of awesome Python code formatters
Stars: ✭ 168 (+175.41%)
Mutual labels:  formatter, formatting
formatting
源码格式自动化调整工具
Stars: ✭ 37 (-39.34%)
Mutual labels:  formatter, formatting
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: ✭ 31 (-49.18%)
Mutual labels:  formatter, formatting
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (-32.79%)
Mutual labels:  formatter, formatting
kirai
String formatting library for Java, Android, Web and Unix Terminal
Stars: ✭ 69 (+13.11%)
Mutual labels:  formatter, formatting
Gitlab.visualstudio
GitLab Extension for Visual Studio
Stars: ✭ 48 (-21.31%)
Mutual labels:  visual-studio
Openapi Connected Service
Visual Studio extension to generate OpenAPI (Swagger) web service reference.
Stars: ✭ 57 (-6.56%)
Mutual labels:  visual-studio
Openpmd Standard
📓 Open Standard for Particle-Mesh Data
Stars: ✭ 47 (-22.95%)
Mutual labels:  document
Installvscode
Stars: ✭ 46 (-24.59%)
Mutual labels:  visual-studio
Rspec Hue formatter
Bring RSpec integration into your room with Philips Hue
Stars: ✭ 59 (-3.28%)
Mutual labels:  formatter

VSE-FormatDocumentOnSave

Enables auto formatting of the code when you save a file. Visual Studio supports auto formatting of the code with the CTRL+E,D or CTRL+E,F key shortcuts but with this extension the command Edit.FormatDocument is executed on Save.

Download

https://marketplace.visualstudio.com/items?itemName=mynkow.FormatdocumentonSave

Configuration

There are 5 settings which you could configure:

  • Command
  • Allowed extensions
  • Denied Extensions
  • Enable
  • Enable in Debug

Command

This is the Visual Studio command which will be invoked when a document is saved. For multiple values you could use space separated list.

Default

Edit.FormatDocument

Allowed extensions

Specifies all file extensions where the command is allowed to be executed. For multiple values you could use space separated list.

Default

allowed_extensions = .*

Denied extensions

Specifies all file extensions where the command is NOT allowed to be executed. For multiple values you could use space separated list.

Default

denied_extensions =

Debug mode

By default the plugin is disabled in debug mode. You could explicitly configure to have the extension enabled while in a debug session.

Default

enable_in_debug = false

Examples

Scenario 1

  • allowed_extensions = .*
  • denied_extensions = .cs

Result: All documents will be formatted because we explicitly specified that all extensions will be formatted using allowed_extensions = .*.

Scenario 2

  • allowed_extensions =
  • denied_extensions = .js

Result: All documents will be formatted except those with .js extension

Scenario 3

  • allowed_extensions =
  • denied_extensions = .*

Result: No documents will be formatted

Scenario 4

  • allowed_extensions = .cs
  • denied_extensions = .*

Result: Only documents with .cs extension will be formatted

Scenario 5

  • allowed_extensions = .cs
  • denied_extensions =

Result: All documents will be formatted because nothing is denied

Scenario 6

  • allowed_extensions = .cs
  • denied_extensions = .cs

Result: All documents will be formatted because there is a conflict

Visual Studio

You can configure these settings from the Visual Studio Options menu

Format Config

Create a .formatconfig file in the root of your project

Note: If you have a .formatconfig file, the VS options are ignored!

Example

root = true

[*.*]
enable = true
command = Edit.FormatDocument
allowed_extensions = 
denied_extensions = .js .html

Example with multiple commands

root = true

[*.*]

command = Edit.FormatDocument Edit.FormatDocument
allowed_extensions = 
denied_extensions = .js .html

Disable the extension

If you wish to temporarily disable to extension you could press CapsLock.
By default the extension is disabled while in a debug session. You could change that from the configuration. You can enable or disable the extension in the configuration, or disable in a .formatconfig file.

Contribute

To setup development environment follow the steps:

  • Install Visual Studio SDK from Visual Studio Installer https://prnt.sc/umv2ak

  • Clone the project

  • Configure debug Open project properties and go to the Debug tab. Select Start external program: and enter the path to your Visual Studio exe. For example C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe. In the Command line arguments: type /rootsuffix Exp https://prnt.sc/umv47r

  • Debug When you press F5 a new instance of Visual Studio will open. From there you need to load an exising solution, file or create a new one. When you press ctrl + s it will trigger break points you have set in the initial Visual Studio instance.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].