mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 09:34:50 +00:00
fix: dont prefetch file contents if it's not editable/viewable (#6632)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user