using:vscode:formatting_preferences

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:

  1. Open the Command Palette and execute the command Preferences: Configure Language Specific Settings...TLA+.
  2. 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 (default 4).
  • editor.insertSpaces — insert spaces when pressing Tab (default true).
  • editor.formatOnType — whether to format code when typing (default true).
  • editor.detectIndentation — whether to automatically detect the editor.tabSize and editor.insertSpaces values when a file is opened (default false).

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
}
  • using/vscode/formatting_preferences.txt
  • Last modified: 2024/10/19 19:03
  • by fponzi