From 343c88574a6b9b701fc7dcf0edba185cfc1eb28f Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Tue, 19 Nov 2024 00:56:45 +0000 Subject: [PATCH] Improve file_types in default.json (#20429) Detect .env.* as Shell Script Move non glob json/jsonc/toml file_types into langauges/*/config.toml --- assets/settings/default.json | 11 ++--------- crates/languages/src/json/config.toml | 2 +- crates/languages/src/jsonc/config.toml | 2 +- extensions/toml/languages/toml/config.toml | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 2352e75ee9..7c4a9a8111 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -873,15 +873,8 @@ // "file_types": { "Plain Text": ["txt"], - "JSON": ["flake.lock"], - "JSONC": [ - "**/.zed/**/*.json", - "**/zed/**/*.json", - "**/Zed/**/*.json", - "tsconfig.json", - "pyrightconfig.json" - ], - "TOML": ["uv.lock"] + "JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json"], + "Shell Script": [".env.*"] }, /// By default use a recent system version of node, or install our own. /// You can override this to use a version of node that is not in $PATH with: diff --git a/crates/languages/src/json/config.toml b/crates/languages/src/json/config.toml index c4a91c20b0..dc49f4f36e 100644 --- a/crates/languages/src/json/config.toml +++ b/crates/languages/src/json/config.toml @@ -1,6 +1,6 @@ name = "JSON" grammar = "json" -path_suffixes = ["json"] +path_suffixes = ["json", "flake.lock"] line_comments = ["// "] autoclose_before = ",]}" brackets = [ diff --git a/crates/languages/src/jsonc/config.toml b/crates/languages/src/jsonc/config.toml index fe62764b27..226ae92912 100644 --- a/crates/languages/src/jsonc/config.toml +++ b/crates/languages/src/jsonc/config.toml @@ -1,6 +1,6 @@ name = "JSONC" grammar = "jsonc" -path_suffixes = ["jsonc"] +path_suffixes = ["jsonc", "tsconfig.json", "pyrightconfig.json"] line_comments = ["// "] autoclose_before = ",]}" brackets = [ diff --git a/extensions/toml/languages/toml/config.toml b/extensions/toml/languages/toml/config.toml index d5c1172d84..f62290d9e9 100644 --- a/extensions/toml/languages/toml/config.toml +++ b/extensions/toml/languages/toml/config.toml @@ -1,6 +1,6 @@ name = "TOML" grammar = "toml" -path_suffixes = ["Cargo.lock", "toml", "Pipfile"] +path_suffixes = ["Cargo.lock", "toml", "Pipfile", "uv.lock"] line_comments = ["# "] autoclose_before = ",]}" brackets = [