fix: dont prefetch file contents if it's not editable/viewable (#6632)

This commit is contained in:
Calum H.
2026-07-06 17:06:41 +00:00
committed by GitHub
parent 34228a5b6c
commit 76320f227f
3 changed files with 12 additions and 9 deletions
+8
View File
@@ -89,6 +89,14 @@ export function isEditableFile(ext: string): boolean {
return isCodeFile(ext) || isTextFile(ext)
}
/**
* Check if a file can be opened in the file editor
*/
export function canOpenInFileEditor(filename: string): boolean {
const ext = getFileExtension(filename)
return !filename.includes('.') || isEditableFile(ext) || isImageFile(ext)
}
/**
* Get Ace editor language mode for a file extension
*/