File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,13 @@ final class Workspace {
129129 " Suggestion feature is disabled for this project. "
130130 }
131131 }
132+
133+ struct UnsupportedFileError : Error , LocalizedError {
134+ var extensionName : String
135+ var errorDescription : String ? {
136+ " File type \( extensionName) unsupported. "
137+ }
138+ }
132139
133140 let projectRootURL : URL
134141 let openedFileRecoverableStorage : OpenedFileRecoverableStorage
@@ -223,6 +230,11 @@ final class Workspace {
223230 static func fetchOrCreateWorkspaceIfNeeded( fileURL: URL ) async throws
224231 -> ( workspace: Workspace , filespace: Filespace )
225232 {
233+ let ignoreFileExtensions = [ " mlmodel " ]
234+ if ignoreFileExtensions. contains ( fileURL. pathExtension) {
235+ throw UnsupportedFileError ( extensionName: fileURL. pathExtension)
236+ }
237+
226238 // If we know which project is opened.
227239 if let currentProjectURL = try await Environment . fetchCurrentProjectRootURLFromXcode ( ) {
228240 if let existed = workspaces [ currentProjectURL] {
You can’t perform that action at this time.
0 commit comments