Improve file_types in default.json (#20429)

Peter Tripp created

Detect .env.* as Shell Script
Move non glob json/jsonc/toml file_types into langauges/*/config.toml

Change summary

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(-)

Detailed changes

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:

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 = [

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 = [

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 = [