forked from microsoft/vscode-editorconfig
-
Notifications
You must be signed in to change notification settings - Fork 117
How it Works
Jed Mao edited this page May 28, 2019
·
1 revision
The EditorConfig extension for VS Code works by leveraging the VS Code API in response to the following scenarios:
- The active text editor receives focus or a window receives focus.
- Apply text editor options received by running
editorconfig
against the file name in question.- This must happen every single time, because the
.editorconfig
file could have changed between a blur and focus event. - Previous text editor options are restored on blur.
- This must happen every single time, because the
- Apply text editor options received by running
- Pre-save Transformations via
TextEdit
.- Set end of line.
- Trim trailing whitespace.
- Insert final newline.
All other transformations are applied on file save, but not by this extension directly. Instead, the job of EditorConfig is to set the appropriate editor options and let the editor take over from there. As such, VS Code is responsible for applying save transformations that follow.