From f4413b0969b26361a822754f8e00aea9f3fd1229 Mon Sep 17 00:00:00 2001 From: Derek Briggs Date: Wed, 19 Jul 2023 12:07:00 -0600 Subject: [PATCH] =?UTF-8?q?Fix=20files=20that=20don=E2=80=99t=20have=20a?= =?UTF-8?q?=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/icons/file_icons/file_types.json | 1 + crates/project_panel/src/file_associations.rs | 9 ++++++++- styles/src/style_tree/project_panel.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/icons/file_icons/file_types.json b/assets/icons/file_icons/file_types.json index d1b604f05e..b1da28d2d6 100644 --- a/assets/icons/file_icons/file_types.json +++ b/assets/icons/file_icons/file_types.json @@ -46,6 +46,7 @@ "ppt": "document", "pptx": "document", "prettierrc": "prettier", + "prettierignore": "prettier", "ps1": "terminal", "psd": "image", "py": "code", diff --git a/crates/project_panel/src/file_associations.rs b/crates/project_panel/src/file_associations.rs index 2d3413ef34..e692031704 100644 --- a/crates/project_panel/src/file_associations.rs +++ b/crates/project_panel/src/file_associations.rs @@ -44,7 +44,14 @@ impl FileAssociations { let this = cx.has_global::().then(|| cx.global::())?; iife!({ - let suffix = path.extension()?.to_str()?; + let suffix = + path.file_name() + .and_then(|os_str| os_str.to_str()) + .and_then(|file_name| { + file_name + .find('.') + .and_then(|dot_index| file_name.get(dot_index + 1..)) + } )?; this.suffixes .get(suffix) diff --git a/styles/src/style_tree/project_panel.ts b/styles/src/style_tree/project_panel.ts index 4a252572d5..e239f9a840 100644 --- a/styles/src/style_tree/project_panel.ts +++ b/styles/src/style_tree/project_panel.ts @@ -47,7 +47,7 @@ export default function project_panel(): any { height: 22, background: background(theme.middle), chevron_color: foreground(theme.middle, "variant"), - icon_color: foreground(theme.middle, "active"), + icon_color: with_opacity(foreground(theme.middle, "active"), 0.3), chevron_size: 7, icon_size: 14, icon_spacing: 6,