mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 12:19:28 +00:00
Fix a bug when extension loading is failed after it's folder is viewed by MacOS finder (#8111)
Fixes #8096 # Bug description I was experimenting with adding extensions and almost went crazy trying to make my demo extension work. It appeared that I was copying files with Finder that creates hidden `.DS_Store` files which interfered with Zed's loading logic. It assumes that `languages/` directory contains only directories and never files and so it crashes when meets `.DS_Store`. This makes any extension stop working after it has been viewed via Finder # Change Check if path is directory when loading extension languages (so it will skip .DS_Store files)
This commit is contained in:
parent
d3745a3931
commit
7bf16f263e
1 changed files with 6 additions and 0 deletions
|
@ -651,6 +651,12 @@ impl ExtensionStore {
|
|||
let Ok(relative_path) = language_path.strip_prefix(&extension_dir) else {
|
||||
continue;
|
||||
};
|
||||
let Ok(Some(fs_metadata)) = fs.metadata(&language_path).await else {
|
||||
continue;
|
||||
};
|
||||
if !fs_metadata.is_dir {
|
||||
continue;
|
||||
}
|
||||
let config = fs.load(&language_path.join("config.toml")).await?;
|
||||
let config = ::toml::from_str::<LanguageConfig>(&config)?;
|
||||
|
||||
|
|
Loading…
Reference in a new issue