feat(languages): recognize Apple entitlements, privacy manifests, String Catalogs, xcconfig and .strings files (#7021)

.entitlements and .xcprivacy open as XML property lists and .xcstrings as JSON; .xcconfig and .strings get small language definitions that use the C mode for comments, #include and quoted strings. Each gets a matching file icon.

Closes #7018

Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
LU XIANGRUIтаwildcatDownstairs authored and GitHub committed 2026-11-30 21:25:40 +08:00
1 джерело f7f2efaace
коміт c864cec32f
9 files changed
+37 -6

No files matched your search

+7
Переглянути файл
@@ -90,6 +90,7 @@ const BUILTIN: &[(&str, &str)] = &[
("slint", include_str!("../../../languages/slint.toml")),
("sql", include_str!("../../../languages/sql.toml")),
("svelte", include_str!("../../../languages/svelte.toml")),
("strings", include_str!("../../../languages/strings.toml")),
("swift", include_str!("../../../languages/swift.toml")),
("terraform", include_str!("../../../languages/terraform.toml")),
("terraform-vars", include_str!("../../../languages/terraform-vars.toml")),
@@ -98,6 +99,7 @@ const BUILTIN: &[(&str, &str)] = &[
("typescriptreact", include_str!("../../../languages/typescriptreact.toml")),
("typst", include_str!("../../../languages/typst.toml")),
("vue", include_str!("../../../languages/vue.toml")),
("xcconfig", include_str!("../../../languages/xcconfig.toml")),
("xml", include_str!("../../../languages/xml.toml")),
("yaml", include_str!("../../../languages/yaml.toml")),
("zig", include_str!("../../../languages/zig.toml")),
@@ -1277,6 +1279,11 @@ mod tests {
("P.cs", "csharp"),
("V.swift", "swift"),
("AppDelegate.m", "objective-c"),
("App.entitlements", "xml"),
("PrivacyInfo.xcprivacy", "xml"),
("Localizable.xcstrings", "json"),
("Debug.xcconfig", "xcconfig"),
("en.lproj/Localizable.strings", "strings"),
("a.rb", "ruby"),
("Gemfile", "ruby"),
("show.html.erb", "erb"),
+2
Переглянути файл
@@ -170,6 +170,7 @@ The table lists every built-in language definition. Server and debugger names in
| Slint | `slint` | `.slint` | Yes | — | **slint-lsp** | — |
| SQL | `sql` | `.sql`, `.ddl`, `.dml`, `.psql`, `.pgsql`, … | Yes | — | **sqls** | — |
| Svelte | `svelte` | `.svelte` | Yes | — | **svelte-language-server** + **oxlint** | — |
| Strings | `strings` | `.strings` | Yes | — | — | — |
| Swift | `swift` | `.swift`, `.swiftinterface` | Yes | Yes | sourcekit-lsp | lldb-dap |
| Terraform | `terraform` | `.tf`, `.tofu`, `.tftest.hcl` | Yes | Yes | **terraform-ls** | — |
| Terraform Variables | `terraform-vars` | `.tfvars` | Yes | Yes | **terraform-ls** | — |
@@ -178,6 +179,7 @@ The table lists every built-in language definition. Server and debugger names in
| TypeScript JSX | `typescriptreact` | `.tsx` | Yes | Yes | **vtsls** → **typescript-language-server** + **oxlint** + **biome** | **js-debug** |
| Typst | `typst` | `.typ` | — | — | **tinymist** | — |
| Vue | `vue` | `.vue` | Yes | — | **vue-language-server**, **vtsls** + **oxlint** | — |
| Xcode Config | `xcconfig` | `.xcconfig` | Yes | — | — | — |
| XML | `xml` | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, … | Yes | Yes | **lemminx** | — |
| YAML | `yaml` | `.yaml`, `.yml` | Yes | Yes | **yaml-language-server** | — |
| Zig | `zig` | `.zig`, `.zon` | Yes | Yes | **zls** | **codelldb** |
+2
Переглянути файл
@@ -165,6 +165,7 @@ IDE 安装工具从不需要 `sudo`。工具装在本地数据目录下 IDE 自
| Slint | `slint` | `.slint` | 是 | — | **slint-lsp** | — |
| SQL | `sql` | `.sql`, `.ddl`, `.dml`, `.psql`, `.pgsql`, … | 是 | — | **sqls** | — |
| Svelte | `svelte` | `.svelte` | 是 | — | **svelte-language-server** + **oxlint** | — |
| Strings | `strings` | `.strings` | 是 | — | — | — |
| Swift | `swift` | `.swift`, `.swiftinterface` | 是 | 是 | sourcekit-lsp | lldb-dap |
| Terraform | `terraform` | `.tf`, `.tofu`, `.tftest.hcl` | 是 | 是 | **terraform-ls** | — |
| Terraform Variables | `terraform-vars` | `.tfvars` | 是 | 是 | **terraform-ls** | — |
@@ -173,6 +174,7 @@ IDE 安装工具从不需要 `sudo`。工具装在本地数据目录下 IDE 自
| TypeScript JSX | `typescriptreact` | `.tsx` | 是 | 是 | **vtsls** → **typescript-language-server** + **oxlint** + **biome** | **js-debug** |
| Typst | `typst` | `.typ` | — | — | **tinymist** | — |
| Vue | `vue` | `.vue` | 是 | — | **vue-language-server**, **vtsls** + **oxlint** | — |
| Xcode Config | `xcconfig` | `.xcconfig` | 是 | — | — | — |
| XML | `xml` | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, … | 是 | 是 | **lemminx** | — |
| YAML | `yaml` | `.yaml`, `.yml` | 是 | 是 | **yaml-language-server** | — |
| Zig | `zig` | `.zig`, `.zon` | 是 | 是 | **zls** | **codelldb** |
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
id = "json"
name = "JSON"
formatter = { tool = "prettier", parser = "json", range = true }
extensions = ["json", "geojson", "topojson", "webmanifest", "har", "avsc", "jsonl", "ndjson", "json.map", "uproject", "uplugin"]
extensions = ["json", "geojson", "topojson", "webmanifest", "har", "avsc", "jsonl", "ndjson", "json.map", "uproject", "uplugin", "xcstrings"]
filenames = [".prettierrc", ".watchmanconfig", "composer.lock", ".arcconfig"]
indent = { tab-size = 2, insert-spaces = true }
ui-mode = "JSON"
+8
Переглянути файл
@@ -0,0 +1,8 @@
id = "strings"
name = "Strings"
extensions = ["strings"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
# Apple `.strings`: `"key" = "value";` with C comments, so the C mode colours it.
ui-mode = "C"
+7
Переглянути файл
@@ -0,0 +1,7 @@
id = "xcconfig"
name = "Xcode Config"
extensions = ["xcconfig"]
line-comment = "//"
indent = { tab-size = 4, insert-spaces = true }
# C-like: `//` comments, `#include` directives and quoted values.
ui-mode = "C"
+1 -1
Переглянути файл
@@ -1,6 +1,6 @@
id = "xml"
name = "XML"
extensions = ["xml", "xsd", "xsl", "xslt", "svg", "plist", "csproj", "fsproj", "vbproj", "props", "targets", "nuspec", "xaml", "resx", "wsdl", "fxml", "iml", "jnlp", "rss", "atom", "xliff", "xlf", "storyboard", "xib", "tld", "pom"]
extensions = ["xml", "xsd", "xsl", "xslt", "svg", "plist", "entitlements", "xcprivacy", "csproj", "fsproj", "vbproj", "props", "targets", "nuspec", "xaml", "resx", "wsdl", "fxml", "iml", "jnlp", "rss", "atom", "xliff", "xlf", "storyboard", "xib", "tld", "pom"]
filenames = ["NuGet.Config", "Directory.Build.targets", "web.config", "app.config"]
first-line = "^<\\?xml\\b"
block-comment = ["<!--", "-->"]
+5
Переглянути файл
@@ -224,6 +224,11 @@ describe("fileIconName", () => {
["build.gradle.kts", "file-gradle-kts"],
["pom.xml", "file-maven"],
["App.swift", "file-swift"],
["App.entitlements", "file-xml"],
["PrivacyInfo.xcprivacy", "file-xml"],
["Localizable.xcstrings", "file-json"],
["Debug.xcconfig", "file-config"],
["Localizable.strings", "file-properties"],
["app.rb", "file-ruby"],
["init.lua", "file-lua"],
["build.zig", "file-zig"],
+4 -4
Переглянути файл
@@ -1181,7 +1181,7 @@ const EXT_ICONS = table({
"file-freemarker": "ftl ftlh ftlx",
"file-astro": "astro",
"file-json":
"json jsonc json5 jsonl ndjson geojson topojson webmanifest har avsc code-workspace code-snippets map uproject uplugin",
"json jsonc json5 jsonl ndjson geojson topojson webmanifest har avsc code-workspace code-snippets map uproject uplugin xcstrings",
"file-md": "md mdx markdown mdown mkd mkdn mdwn ronn workbook",
"file-word": "doc docx rtf odt",
"file-pdf": "pdf",
@@ -1198,7 +1198,7 @@ const EXT_ICONS = table({
"file-sass": "sass",
"file-scss": "scss",
"file-xml":
"xml xsl xslt plist csproj fsproj vbproj props targets nuspec xaml axaml resx wsdl fxml iml jnlp rss atom " +
"xml xsl xslt plist entitlements xcprivacy csproj fsproj vbproj props targets nuspec xaml axaml resx wsdl fxml iml jnlp rss atom " +
"xliff xlf storyboard xib tld pom",
"file-xsd": "xsd",
"file-shell": "sh bash zsh ksh ash dash bats fish command",
@@ -1209,11 +1209,11 @@ const EXT_ICONS = table({
"file-proto": "proto",
"file-image": "png jpg jpeg gif svg webp ico icns bmp tif tiff avif",
"file-archive": "zip tar gz tgz bz2 xz zst 7z rar jar war whl egg",
"file-config": "ini cfg conf cnf inf reg url desktop service socket timer config",
"file-config": "ini cfg conf cnf inf reg url desktop service socket timer config xcconfig",
"file-dotenv": "env",
"file-lock": "lock lockb",
"file-ignored": "dockerignore gitignore",
"file-properties": "properties prefs",
"file-properties": "properties prefs strings",
"file-font": "ttf otf woff woff2",
"file-patch": "patch diff rej",
"file-java": "java",