Add block_comment
to JS, TSX, and TS (#31400)
This is the first step of ["Solution proposal for folding multiline comments with no indentation"](https://github.com/zed-industries/zed/discussions/31395): > 1. Add block_comment in the config.toml for the languages javascript, typescript, tsx. These are simple languages for this feature, and I am already familiar with them. The next step will be: > 2. Modify the function `crease_for_buffer_row` in `DisplaySnapshot` to handle multiline comments. `editor::fold` and `editor::fold_all` will handle multiline comments after this change. To my knowledge, `editor::unfold`, `editor::unfold_all`, and the **unfold** indicator in the gutter will already work after folding, but there will be no **fold** indicator. Release Notes: - N/A
This commit is contained in:
parent
10af3c7e58
commit
29f0762b6c
4 changed files with 20 additions and 0 deletions
|
@ -4,6 +4,7 @@ path_suffixes = ["js", "jsx", "mjs", "cjs"]
|
|||
# [/ ] is so we match "env node" or "/node" but not "ts-node"
|
||||
first_line_pattern = '^#!.*\b(?:[/ ]node|deno run.*--ext[= ]js)\b'
|
||||
line_comments = ["// "]
|
||||
block_comment = ["/*", "*/"]
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
|
|
|
@ -2,6 +2,7 @@ name = "TSX"
|
|||
grammar = "tsx"
|
||||
path_suffixes = ["tsx"]
|
||||
line_comments = ["// "]
|
||||
block_comment = ["/*", "*/"]
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
|
|
|
@ -3,6 +3,7 @@ grammar = "typescript"
|
|||
path_suffixes = ["ts", "cts", "d.cts", "d.mts", "mts"]
|
||||
first_line_pattern = '^#!.*\b(?:deno run|ts-node|bun|tsx)\b'
|
||||
line_comments = ["// "]
|
||||
block_comment = ["/*", "*/"]
|
||||
autoclose_before = ";:.,=}])>"
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue