From 5fd7afb9da3ff54ea1841a99e7c2d32b4beae994 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Mon, 18 Nov 2024 14:23:29 +0000 Subject: [PATCH] docs: More language extension config.toml key documentation (#20818) Release Notes: - N/A --- docs/src/extensions/languages.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/src/extensions/languages.md b/docs/src/extensions/languages.md index b7e0cb4482..e4fc1aca2b 100644 --- a/docs/src/extensions/languages.md +++ b/docs/src/extensions/languages.md @@ -20,22 +20,22 @@ path_suffixes = ["myl"] line_comments = ["# "] ``` -- `name` is the human readable name that will show up in the Select Language dropdown. -- `grammar` is the name of a grammar. Grammars are registered separately, described below. -- `path_suffixes` (optional) is an array of file suffixes that should be associated with this language. This supports glob patterns like `config/**/*.toml` where `**` matches 0 or more directories and `*` matches 0 or more characters. -- `line_comments` (optional) is an array of strings that are used to identify line comments in the language. +- `name` (required) is the human readable name that will show up in the Select Language dropdown. +- `grammar` (required) is the name of a grammar. Grammars are registered separately, described below. +- `path_suffixes` is an array of file suffixes that should be associated with this language. Unlike `file_types` in settings, this does not support glob patterns. +- `line_comments` is an array of strings that are used to identify line comments in the language. This is used for the `editor::ToggleComments` keybind: `{#kb editor::ToggleComments}` for toggling lines of code. +- `tab_size` defines the indentation/tab size used for this language (default is `4`). +- `hard_tabs` whether to indent with tabs (`true`) or spaces (`false`, the default). +- `first_line_pattern` is a regular expression, that in addition to `path_suffixes` (above) or `file_types` in settings can be used to match files which should use this language. For example Zed uses this to identify Shell Scripts by matching the [shebangs lines](https://github.com/zed-industries/zed/blob/main/crates/languages/src/bash/config.toml) in the first line of a script.