Languages
Syncline ships 17 built-in language definitions. Each is a self-contained object that bundles keywords, types, comment tokens, auto-close pairs, file extensions, and a starter set of completions.
Supported Languages
| language id | Name | Extensions | Snippets | Comment token |
|---|---|---|---|---|
'typescript' | TypeScript | ts, tsx | 9 | // |
'javascript' | JavaScript | js, mjs, cjs | 8 | // |
'python' | Python | py | 10 | # |
'java' | Java | java | 10 | // |
'c' | C | c, h | 9 | // |
'cpp' | C++ | cpp, cc, cxx, hpp | 11 | // |
'csharp' | C# | cs | 9 | // |
'go' | Go | go | 7 | // |
'rust' | Rust | rs | 8 | // |
'ruby' | Ruby | rb | 4 | # |
'php' | PHP | php | 4 | // |
'swift' | Swift | swift | 9 | // |
'css' | CSS | css | 4 | /* */ |
'sql' | SQL | sql | 4 | -- |
'json' | JSON | json | 2 | — |
'markdown' | Markdown | md, mdx | — | — |
'text' | Plain Text | txt | — | — |
Applying a Language
Spread .config() into createEditor() or updateConfig() to apply a language. The config patch sets language, lineCommentToken, autoClosePairs, and the default completionsin one call:
Built-in Language Objects
All 17 language objects are exported from the package root:
LANGUAGES Map & Dynamic Lookup
Use LANGUAGES, getLanguage(id), and getLanguageByExtension(ext) when you need to resolve a language at runtime — for example from a filename or a user preference:
LanguageDefinition Fields
| Field | Type | Description |
|---|---|---|
id | string | Language identifier — matches a value in the Language union (e.g. 'python'). |
name | string | Human-readable display name (e.g. 'Python', 'C++'). |
fileExtensions | string[] | File extensions without the dot (e.g. ['ts', 'tsx']). |
lineCommentToken | string | Line-comment prefix used by Ctrl+/ (e.g. '//', '#', '--'). |
blockComment | { open: string; close: string } | undefined | Block comment delimiters, or undefined when unsupported. |
keywords | ReadonlySet<string> | Full keyword set used by the tokeniser. |
types | ReadonlySet<string> | Full built-in type set used by the tokeniser. |
autoClosePairs | Record<string, string> | Auto-close character pairs for this language. |
skipCloseChars | ReadonlySet<string> | Closing characters to skip over instead of insert. |
completions | CompletionItem[] | Default completions bundled with this language. |
config() | () => Partial<EditorConfig> | Returns a config patch that fully activates this language — spread into createEditor() or updateConfig(). |
Extending a Built-in Language
Spread .config() and override or augment any field. Use language.completions to keep all built-in completions and add your own on top:
© 2026 Syncline Editor. All rights reserved.