KScript Dokumentation
DE

Sprache

Automatisch aus dem Englischen übersetzt; das englische Original ist maßgeblich.

Formatierung

Einstellungen

Lege Stileinstellungen unter "format" in kscript.json ab. Jede Einstellung ist optional:

JSON
{
  "format": {
    "indent": 2,              // spaces per level, or "tab"
    "tab_width": 2,            // with "indent": "tab", the columns a tab counts as
    "print_width": 80,         // the longest a line should be; longer lines are wrapped
    "max_blank_lines": 1,       // blank lines kept in a row
    "end_of_line": "auto",      // auto (keep each file's), lf or crlf
    "preserve": ["pre-like"], // elements whose content is kept exactly
    "rules": {},              // turn rules off, e.g. { "statement_per_line": false }; see below
    "enabled": true,          // false: no formatting anywhere in this project
    "include": ["**/*.kscript", "**/*.ks.xml", "**/*.html"],
    "exclude": ["_templates", "node_modules", ".git"]
  }
}

Diese Einstellungen können auch aus einem Standard stammen, sodass mehrere Projekte denselben Stil teilen können: Lege sie unter "format" in einer Standarddatei ab und benenne sie mit "standard" in kscript.json. Der Standard kscript:recommended schreibt die oben genannten Werte aus. Was kscript.json selbst setzt, hat Vorrang vor seinem Standard.

Im Editor werden die eigenen Tab-Einstellungen des Editors (editor.tabSize, editor.insertSpaces) für die Einrückung verwendet, wenn weder kscript.json noch sein Standard sie setzt. Wenn ein Projekt oder dessen Standard format.indent setzt, hat das Vorrang, damit alle im Projekt dasselbe Ergebnis erhalten.

Edit this page on GitHub