-
Notifications
You must be signed in to change notification settings - Fork 33
Formatting Preferences
Federico Ponzi edited this page Oct 19, 2024
·
4 revisions
This page was moved to https://docs.tlapl.us/using:vscode:formatting_preferences
By default, the extension is configured to help you with formatting the code while you're typing. If you want to change any aspect of this behavior, you can do it by editing the tlaplus
language settings. To do that:
- Open the Command Palette and execute the command
Preferences: Configure Language Specific Settings...
→TLA+
. - Set any of the properties listed below to your liking.
Properties, related to formatting:
-
editor.tabSize
— the number of spaces a tab is equal to (default4
). -
editor.insertSpaces
— insert spaces when pressingTab
(defaulttrue
). -
editor.formatOnType
— whether to format code when typing (defaulttrue
). -
editor.detectIndentation
— whether to automatically detect theeditor.tabSize
andeditor.insertSpaces
values when a file is opened (defaultfalse
).
For example, to switch off the automatic formatting and use 2 spaces for indentation, you can change the settings to:
"[tlaplus]": {
"editor.tabSize": 2,
"editor.formatOnType": false
}