Improve auto-detection via shebang of TypeScript, JavaScript and Shell Script (#19114)
This commit is contained in:
parent
bebe24ea77
commit
aefc559f43
4 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,7 @@ code_fence_block_name = "bash"
|
||||||
grammar = "bash"
|
grammar = "bash"
|
||||||
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD"]
|
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD"]
|
||||||
line_comments = ["# "]
|
line_comments = ["# "]
|
||||||
first_line_pattern = "^#!.*\\b(?:ba|z)?sh\\b"
|
first_line_pattern = '^#!.*\b(?:ash|bash|dash|sh|zsh)\b'
|
||||||
brackets = [
|
brackets = [
|
||||||
{ start = "[", end = "]", close = true, newline = false },
|
{ start = "[", end = "]", close = true, newline = false },
|
||||||
{ start = "(", end = ")", close = true, newline = false },
|
{ start = "(", end = ")", close = true, newline = false },
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
name = "JavaScript"
|
name = "JavaScript"
|
||||||
grammar = "tsx"
|
grammar = "tsx"
|
||||||
path_suffixes = ["js", "jsx", "mjs", "cjs"]
|
path_suffixes = ["js", "jsx", "mjs", "cjs"]
|
||||||
first_line_pattern = '^#!.*\bnode\b'
|
# [/ ] is so we match "env node" or "/node" but not "ts-node"
|
||||||
|
first_line_pattern = '^#!.*\b(?:[/ ]node|deno run.*--ext[= ]js)\b'
|
||||||
line_comments = ["// "]
|
line_comments = ["// "]
|
||||||
autoclose_before = ";:.,=}])>"
|
autoclose_before = ";:.,=}])>"
|
||||||
brackets = [
|
brackets = [
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
name = "TypeScript"
|
name = "TypeScript"
|
||||||
grammar = "typescript"
|
grammar = "typescript"
|
||||||
path_suffixes = ["ts", "cts", "d.cts", "d.mts", "mts"]
|
path_suffixes = ["ts", "cts", "d.cts", "d.mts", "mts"]
|
||||||
|
first_line_pattern = '^#!.*\b(?:deno run|ts-node|bun|tsx)\b'
|
||||||
line_comments = ["// "]
|
line_comments = ["// "]
|
||||||
autoclose_before = ";:.,=}])>"
|
autoclose_before = ";:.,=}])>"
|
||||||
brackets = [
|
brackets = [
|
||||||
|
|
|
@ -48,7 +48,6 @@ extend-ignore-re = [
|
||||||
'cl\[ist]',
|
'cl\[ist]',
|
||||||
'\[lan\]guage',
|
'\[lan\]guage',
|
||||||
'"ba"',
|
'"ba"',
|
||||||
":ba\\|z",
|
|
||||||
# :/ crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql
|
# :/ crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql
|
||||||
"COLUMN enviroment",
|
"COLUMN enviroment",
|
||||||
# Typo in ClickHouse column name.
|
# Typo in ClickHouse column name.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue