From d5d38d64766e06f5ed8c8cb0d439f2887ecfe5d8 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Tue, 22 Jul 2025 23:08:13 +1000 Subject: [PATCH 1/2] fix: fix panic deleting file sync session via right click --- .../Coder-Desktop/Views/FileSync/FileSyncConfig.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncConfig.swift b/Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncConfig.swift index 302bd135..c0750567 100644 --- a/Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncConfig.swift +++ b/Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncConfig.swift @@ -165,11 +165,11 @@ struct FileSyncConfig: View { } // TODO: Support selecting & deleting multiple sessions at once - func delete(session _: FileSyncSession) async { + func delete(session: FileSyncSession) async { loading = true defer { loading = false } do throws(DaemonError) { - try await fileSync.deleteSessions(ids: [selection!]) + try await fileSync.deleteSessions(ids: [session.id]) } catch { actionError = error } From 28e48c69f4ceb2a3d8a958014a0fd5b57f09b99f Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Tue, 22 Jul 2025 23:28:38 +1000 Subject: [PATCH 2/2] lint for unused arguments instead of silently formatting them --- Coder-Desktop/.swiftformat | 3 ++- Coder-Desktop/.swiftlint.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Coder-Desktop/.swiftformat b/Coder-Desktop/.swiftformat index b34aa3f1..388c4a61 100644 --- a/Coder-Desktop/.swiftformat +++ b/Coder-Desktop/.swiftformat @@ -1,3 +1,4 @@ --selfrequired log,info,error,debug,critical,fault --exclude **.pb.swift,**.grpc.swift ---condassignment always \ No newline at end of file +--condassignment always +--disable unusedArguments \ No newline at end of file diff --git a/Coder-Desktop/.swiftlint.yml b/Coder-Desktop/.swiftlint.yml index 1c2e5c48..1cf2d055 100644 --- a/Coder-Desktop/.swiftlint.yml +++ b/Coder-Desktop/.swiftlint.yml @@ -3,6 +3,8 @@ disabled_rules: - trailing_comma - blanket_disable_command # Used by Protobuf - opening_brace # Handled by SwiftFormat +opt_in_rules: + - unused_parameter type_name: allowed_symbols: "_" identifier_name: