mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 21:21:36 +00:00
Allow source code-related files
This commit is contained in:
parent
47975870b4
commit
60e5c8f2e2
@ -95,7 +95,8 @@ public record FileAttachment(FileAttachmentType Type, string FileName, string Fi
|
||||
// Check if it's an allowed document file (PDF, Text, or Office):
|
||||
if (FileTypeFilter.PDF.FilterExtensions.Contains(extension) ||
|
||||
FileTypeFilter.Text.FilterExtensions.Contains(extension) ||
|
||||
FileTypeFilter.AllOffice.FilterExtensions.Contains(extension))
|
||||
FileTypeFilter.AllOffice.FilterExtensions.Contains(extension) ||
|
||||
FileTypeFilter.AllSourceCode.FilterExtensions.Contains(extension))
|
||||
return FileAttachmentType.DOCUMENT;
|
||||
|
||||
// All other file types are forbidden:
|
||||
|
||||
@ -25,5 +25,56 @@ public readonly record struct FileTypeFilter(string FilterName, string[] FilterE
|
||||
|
||||
public static FileTypeFilter AllAudio => new(TB("All Audio Files"), ["mp3", "wav", "wave", "aac", "flac", "ogg", "m4a", "wma", "alac", "aiff", "m4b"]);
|
||||
|
||||
public static FileTypeFilter AllSourceCode => new(TB("All Source Code Files"),
|
||||
[
|
||||
// C#:
|
||||
"cs",
|
||||
|
||||
// Java:
|
||||
"java",
|
||||
|
||||
// Python:
|
||||
"py",
|
||||
|
||||
// JavaScript/TypeScript:
|
||||
"js", "ts",
|
||||
|
||||
// C/C++:
|
||||
"c", "cpp", "h", "hpp",
|
||||
|
||||
// Ruby:
|
||||
"rb",
|
||||
|
||||
// Go:
|
||||
"go",
|
||||
|
||||
// Rust:
|
||||
"rs",
|
||||
|
||||
// Lua:
|
||||
"lua",
|
||||
|
||||
// PHP:
|
||||
"php",
|
||||
|
||||
// HTML/CSS:
|
||||
"html", "css",
|
||||
|
||||
// Swift/Kotlin:
|
||||
"swift", "kt",
|
||||
|
||||
// Shell scripts:
|
||||
"sh", "bash",
|
||||
|
||||
// Logging files:
|
||||
"log",
|
||||
|
||||
// JSON/YAML/XML:
|
||||
"json", "yaml", "yml", "xml",
|
||||
|
||||
// Config files:
|
||||
"ini", "cfg", "toml", "plist",
|
||||
]);
|
||||
|
||||
public static FileTypeFilter Executables => new(TB("Executable Files"), ["exe", "app", "bin", "appimage"]);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user