- **fix ignoring ignored files when matching icons** - **remove poorly named and confusing method `PathExt.icon_stem_or_suffix` and refactor `PathExt.extension_or_hidden_file_name` to actually do what it says it does** Closes #24314 Release Notes: - Fixed an issue where hidden files would have the default icon instead of the correct one - Fixed an issue where files with specific icons (such as `eslint.config.js`) would not have the their specific icon without a leading `.` (`.eslint.config.js`)
This commit is contained in:
parent
ad46c5b567
commit
9c132fece5
3 changed files with 40 additions and 52 deletions
|
@ -31,7 +31,7 @@ use sum_tree::Bias;
|
|||
use text::{Point, Rope};
|
||||
use theme::Theme;
|
||||
use unicase::UniCase;
|
||||
use util::{maybe, paths::PathExt, post_inc, ResultExt};
|
||||
use util::{maybe, post_inc, ResultExt};
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, JsonSchema,
|
||||
|
@ -659,7 +659,7 @@ impl LanguageRegistry {
|
|||
user_file_types: Option<&HashMap<Arc<str>, GlobSet>>,
|
||||
) -> Option<AvailableLanguage> {
|
||||
let filename = path.file_name().and_then(|name| name.to_str());
|
||||
let extension = path.extension_or_hidden_file_name();
|
||||
let extension = path.extension().and_then(|ext| ext.to_str());
|
||||
let path_suffixes = [extension, filename, path.to_str()];
|
||||
let empty = GlobSet::empty();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue