Skip to content

Commit 8bb9a29

Browse files
committed
chore: describe the usage of the package better
1 parent 16009d4 commit 8bb9a29

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# Code Format
22

3-
Format a selection of code using the `code-format:format-code` command.
4-
(Also accessible via context menu, or "Edit > Text > Format Code").
3+
## Usage
54

6-
When no selection is provided, the entire file is formatted.
5+
- By default the currently open file is formatted on save.
6+
7+
- Format a selection of code using the `code-format:format-code` (`CTRL+SHIFT+C`) command.
8+
(Also accessible via context menu, or "Edit > Text > Format Code"). When no selection is provided, the entire file is formatted.
9+
10+
- For the languages that support on type formatting, the package is able to format as you type in the editor. You should enable this from the settings of this package (disabled by default).
711

812
![Code Format](https://raw.githubusercontent.com/facebookarchive/atom-ide-ui/master/docs/images/code-format.gif)
913

14+
## Developer Service API
15+
1016
Code Format also provides APIs to:
1117

12-
- format code as you type
1318
- format code on save (after you press save but before writing to disk).
19+
- format code as you type
1420

1521
You can enable format-on-save using plain range/file providers from the atom-ide-code-format's settings
1622

17-
## Service API
18-
1923
Provide code format [Atom services](http://flight-manual.atom.io/behind-atom/sections/interacting-with-other-packages-via-services/) by adding one or more of these to your `package.json`:
2024
(Only the ones that you want to use; you don't need all of them!)
2125

0 commit comments

Comments
 (0)