Simple Code Formatter

approved

by SY

Format the code block where the cursor is.

19 stars3,193 downloadsUpdated 1y agoMIT
View on GitHub

Simple Code Formatter

Format the block of code where the cursor is located

Direction for use

  • Place the cursor in the block of code you want to format.
  • Search "Simple Code Formatter" in Command Palette. alt text
  • Execute it.

Example

alt text

Supported Languges

LanguageFormatter(JS Module)
C(C++)js-beautify
csharpjs-beautify
javaprettier
xmlxml-formatter
sqlsqlformatter
htmlprettier
vueprettier
cssprettier
javascriptprettier
typescriptprettier
json5prettier
scssprettier
lessprettier
graphqlprettier
markdownprettier
yamlprettier

Questions

1. Markdown syntax of the code block

Make sure the Markdown syntax of the code block you want to format is correct.

2. Code syntax in a code block

The plugin will check your code syntax which use prettier of Formatter(JS Module).

Example of Code syntax

alt text

3. If your code doesn't conform to syntax, but you still want to beautify it?

You should bypass the syntax check. You can use a language powered by js-beautify instead of the current language.

After formatting, change it back.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.