From aad6716bbadb03861e13caba41886daaca4c8919 Mon Sep 17 00:00:00 2001 From: vksvicky Date: Tue, 2 Dec 2025 09:24:47 +0000 Subject: [PATCH 1/5] Fix: Update macOS deployment target from 13.0 to 14.0 Resolves build errors with test frameworks (XCTest, Testing) that require macOS 14.0+. This fixes the following linker warnings: - Building for macOS-13.0 but linking with XCTest built for 14.0 - Building for macOS-13.0 but linking with libXCTestSwiftSupport built for 14.0 - Building for macOS-13.0 but linking with Testing framework built for 14.0 --- CodeEdit.xcodeproj/project.pbxproj | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/CodeEdit.xcodeproj/project.pbxproj b/CodeEdit.xcodeproj/project.pbxproj index ff63c4974c..bea022b467 100644 --- a/CodeEdit.xcodeproj/project.pbxproj +++ b/CodeEdit.xcodeproj/project.pbxproj @@ -643,7 +643,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = ""; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -684,7 +684,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = "Change in Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -715,7 +715,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEditTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -777,7 +777,7 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit.OpenWithCodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -840,7 +840,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = ""; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -881,7 +881,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = "Change in Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -912,7 +912,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEditTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -974,7 +974,7 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit.OpenWithCodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1009,7 +1009,7 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit.OpenWithCodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1044,7 +1044,7 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit.OpenWithCodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1108,7 +1108,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = ""; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -1150,7 +1150,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = "Change in Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1181,7 +1181,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEditTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1243,7 +1243,7 @@ "@executable_path/../Frameworks", "@executable_path/../../../../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit.OpenWithCodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1312,7 +1312,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = ""; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -1378,7 +1378,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = ""; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -1418,7 +1418,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = "Change in Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1459,7 +1459,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = "Change in Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEdit; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1490,7 +1490,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEditTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1517,7 +1517,7 @@ "@executable_path/../Frameworks", "@loader_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13.0; + MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = app.codeedit.CodeEditTests; PRODUCT_NAME = "$(TARGET_NAME)"; From 636ead0dd8c78c961a3ab9adbe283e0b5a3f7289 Mon Sep 17 00:00:00 2001 From: vksvicky Date: Tue, 2 Dec 2025 09:29:27 +0000 Subject: [PATCH 2/5] Fix: Resolve deprecation warnings and unreachable code - Updated 80+ instances of onChange(of:perform:) to use the new macOS 14.0+ syntax with two-parameter closures (_, newValue in) - Commented out unreachable code in LSPService.swift after early return - Updated Xcode project settings to version 16.1 (LastUpgradeCheck: 2610) - Enabled app sandbox and JIT runtime exceptions for proper execution - Added string catalog symbol generation This resolves all deprecation warnings when targeting macOS 14.0+. Files affected: 39 files Changes: 95 insertions(+), 76 deletions(-) --- CodeEdit.xcodeproj/project.pbxproj | 22 ++++++++++++++++++- .../xcshareddata/xcschemes/CodeEdit.xcscheme | 2 +- .../xcschemes/OpenWithCodeEdit.xcscheme | 2 +- CodeEdit/CodeEdit.entitlements | 4 ---- .../Notifications/TaskNotificationView.swift | 2 +- .../TaskNotificationsDetailView.swift | 2 +- .../Views/EnvironmentVariableListItem.swift | 6 ++--- .../CodeEditUI/Views/KeyValueTable.swift | 2 +- .../Views/WorkspacePanelTabBar.swift | 2 +- .../JumpBar/Views/EditorJumpBarView.swift | 8 +++---- .../Editor/TabBar/Tabs/Views/EditorTabs.swift | 4 ++-- .../Features/Editor/Views/CodeFileView.swift | 2 +- .../Editor/Views/EditorAreaView.swift | 4 ++-- .../FileInspector/FileInspectorView.swift | 14 ++++++------ .../HistoryInspectorView.swift | 6 ++--- .../Views/InspectorAreaView.swift | 2 +- .../Features/LSP/Service/LSPService.swift | 3 +++ .../FindNavigator/FindNavigatorForm.swift | 2 +- ...rceControlNavigatorChangesCommitView.swift | 2 +- .../SourceControlNavigatorChangesList.swift | 2 +- .../SourceControlNavigatorHistoryView.swift | 4 ++-- .../ChangedFile/GitChangedFileListView.swift | 4 ++-- .../Views/NotificationPanelView.swift | 12 +++++----- .../AccountsSettingsDetailsView.swift | 2 +- .../Extensions/LanguageServersView.swift | 2 +- .../GeneralSettings/GeneralSettingsView.swift | 4 ++-- .../SourceControlGitView.swift | 8 +++---- .../ThemeSettingsThemeToken.swift | 2 +- .../ThemeSettings/ThemeSettingsView.swift | 8 +++---- .../Settings/Views/GlobPatternListItem.swift | 2 +- .../Settings/Views/MonospacedFontPicker.swift | 2 +- .../Settings/Views/SettingsColorPicker.swift | 2 +- .../Views/RemoteBranchPicker.swift | 2 +- .../ViewModifiers/UpdateStatusBarInfo.swift | 2 +- .../StatusBarToggleUtilityAreaButton.swift | 2 +- .../Tasks/Views/StopTaskToolbarButton.swift | 4 ++-- .../UtilityAreaTerminalSidebar.swift | 2 +- .../WindowCommands/TasksCommands.swift | 2 +- CodeEdit/WorkspaceView.swift | 12 +++++----- 39 files changed, 95 insertions(+), 76 deletions(-) diff --git a/CodeEdit.xcodeproj/project.pbxproj b/CodeEdit.xcodeproj/project.pbxproj index bea022b467..2b2a39b04a 100644 --- a/CodeEdit.xcodeproj/project.pbxproj +++ b/CodeEdit.xcodeproj/project.pbxproj @@ -397,7 +397,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1330; - LastUpgradeCheck = 1640; + LastUpgradeCheck = 2610; TargetAttributes = { 2BE487EB28245162003F3F64 = { CreatedOnToolsVersion = 13.3.1; @@ -650,6 +650,7 @@ OTHER_SWIFT_FLAGS = "-D ALPHA"; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; @@ -673,6 +674,7 @@ DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"CodeEdit/Preview Content\""; DEVELOPMENT_TEAM = ""; + ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = NO; @@ -690,6 +692,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; REGISTER_APP_GROUPS = YES; + RUNTIME_EXCEPTION_ALLOW_JIT = YES; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; RUN_DOCUMENTATION_COMPILER = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; @@ -847,6 +851,7 @@ OTHER_SWIFT_FLAGS = "-D BETA"; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; @@ -870,6 +875,7 @@ DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"CodeEdit/Preview Content\""; DEVELOPMENT_TEAM = ""; + ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = NO; @@ -887,6 +893,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; REGISTER_APP_GROUPS = YES; + RUNTIME_EXCEPTION_ALLOW_JIT = YES; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; RUN_DOCUMENTATION_COMPILER = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; @@ -1115,6 +1123,7 @@ OTHER_SWIFT_FLAGS = "-D ALPHA"; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; @@ -1139,6 +1148,7 @@ DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"CodeEdit/Preview Content\""; DEVELOPMENT_TEAM = ""; + ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = NO; @@ -1156,6 +1166,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; REGISTER_APP_GROUPS = YES; + RUNTIME_EXCEPTION_ALLOW_JIT = YES; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; RUN_DOCUMENTATION_COMPILER = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; @@ -1319,6 +1331,7 @@ ONLY_ACTIVE_ARCH = YES; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; @@ -1384,6 +1397,7 @@ MTL_FAST_MATH = YES; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SYSTEM_FRAMEWORK_SEARCH_PATHS = ""; @@ -1407,6 +1421,7 @@ DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"CodeEdit/Preview Content\""; DEVELOPMENT_TEAM = ""; + ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = NO; @@ -1424,6 +1439,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; REGISTER_APP_GROUPS = YES; + RUNTIME_EXCEPTION_ALLOW_JIT = YES; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; RUN_DOCUMENTATION_COMPILER = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; @@ -1448,6 +1465,7 @@ DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"CodeEdit/Preview Content\""; DEVELOPMENT_TEAM = ""; + ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = NO; @@ -1465,6 +1483,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; REGISTER_APP_GROUPS = YES; + RUNTIME_EXCEPTION_ALLOW_JIT = YES; + RUNTIME_EXCEPTION_DISABLE_LIBRARY_VALIDATION = YES; RUN_DOCUMENTATION_COMPILER = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; diff --git a/CodeEdit.xcodeproj/xcshareddata/xcschemes/CodeEdit.xcscheme b/CodeEdit.xcodeproj/xcshareddata/xcschemes/CodeEdit.xcscheme index 2c80a13978..e0bdbb1fb8 100644 --- a/CodeEdit.xcodeproj/xcshareddata/xcschemes/CodeEdit.xcscheme +++ b/CodeEdit.xcodeproj/xcshareddata/xcschemes/CodeEdit.xcscheme @@ -1,6 +1,6 @@ app.codeedit.CodeEdit.shared $(TeamIdentifierPrefix) - com.apple.security.cs.allow-jit - - com.apple.security.cs.disable-library-validation - diff --git a/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationView.swift b/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationView.swift index bc6a2be2bf..c73d8f229d 100644 --- a/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationView.swift +++ b/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationView.swift @@ -49,7 +49,7 @@ struct TaskNotificationView: View { } } .animation(.easeInOut, value: notification) - .onChange(of: taskNotificationHandler.notifications) { newValue in + .onChange(of: taskNotificationHandler.notifications) { _, newValue in withAnimation { notification = newValue.first } diff --git a/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationsDetailView.swift b/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationsDetailView.swift index 4742fa8174..df417c0d25 100644 --- a/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationsDetailView.swift +++ b/CodeEdit/Features/ActivityViewer/Notifications/TaskNotificationsDetailView.swift @@ -35,7 +35,7 @@ struct TaskNotificationsDetailView: View { } .padding(15) .frame(minWidth: 320) - .onChange(of: taskNotificationHandler.notifications) { newValue in + .onChange(of: taskNotificationHandler.notifications) { _, newValue in if selectedTaskNotificationIndex >= newValue.count { selectedTaskNotificationIndex = 0 } diff --git a/CodeEdit/Features/CEWorkspaceSettings/Views/EnvironmentVariableListItem.swift b/CodeEdit/Features/CEWorkspaceSettings/Views/EnvironmentVariableListItem.swift index 07fccfc3e3..e16bd5c763 100644 --- a/CodeEdit/Features/CEWorkspaceSettings/Views/EnvironmentVariableListItem.swift +++ b/CodeEdit/Features/CEWorkspaceSettings/Views/EnvironmentVariableListItem.swift @@ -50,7 +50,7 @@ struct EnvironmentVariableListItem: View { .autocorrectionDisabled() .labelsHidden() } - .onChange(of: isKeyFocused) { isFocused in + .onChange(of: isKeyFocused) { _, isFocused in if isFocused { if selectedEnvID != environmentVariable.id { selectedEnvID = environmentVariable.id @@ -62,10 +62,10 @@ struct EnvironmentVariableListItem: View { } } } - .onChange(of: key) { newValue in + .onChange(of: key) { _, newValue in environmentVariable.key = newValue } - .onChange(of: value) { newValue in + .onChange(of: value) { _, newValue in environmentVariable.value = newValue } } diff --git a/CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift b/CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift index 4909417ee3..4fc7ab95d8 100644 --- a/CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift +++ b/CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift @@ -203,7 +203,7 @@ struct KeyValueTable: View { } selection = [] } - .onChange(of: items) { newValue in + .onChange(of: items) { _, newValue in updateTableItems(newValue) } } diff --git a/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift b/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift index d3ef997a01..4e6ec36580 100644 --- a/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift +++ b/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift @@ -284,7 +284,7 @@ struct WorkspacePanelTabBar: View { .onChange(of: geometry.frame(in: .global)) { newFrame in self.tabLocations[tab] = newFrame } - .onChange(of: geometry.size.width) { newWidth in + .onChange(of: geometry.size.width) { _, newWidth in self.tabWidth[tab] = newWidth } } diff --git a/CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift b/CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift index 70a931816d..9dda335439 100644 --- a/CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift +++ b/CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift @@ -88,7 +88,7 @@ struct EditorJumpBarView: View { textWidth = proxy.size.width } } - .onChange(of: proxy.size.width) { newValue in + .onChange(of: proxy.size.width) { _, newValue in if crumbWidth == nil { textWidth = newValue } @@ -99,15 +99,15 @@ struct EditorJumpBarView: View { .onAppear { containerWidth = containerProxy.size.width } - .onChange(of: containerProxy.size.width) { newValue in + .onChange(of: containerProxy.size.width) { _, newValue in containerWidth = newValue } - .onChange(of: textWidth) { _ in + .onChange(of: textWidth) { _, _ in withAnimation(.easeInOut(duration: 0.2)) { resize() } } - .onChange(of: containerWidth) { _ in + .onChange(of: containerWidth) { _, _ in withAnimation(.easeInOut(duration: 0.2)) { resize() } diff --git a/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift b/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift index 2b2d5acbc2..fe113b96d2 100644 --- a/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift +++ b/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift @@ -331,14 +331,14 @@ struct EditorTabs: View { } } // When selected tab is changed, scroll to it if possible. - .onChange(of: editor.selectedTab) { newValue in + .onChange(of: editor.selectedTab) { _, newValue in withAnimation { scrollReader.scrollTo(newValue?.file.id) } } // When window size changes, re-compute the expected tab width. - .onChange(of: geometryProxy.size.width) { _ in + .onChange(of: geometryProxy.size.width) { _, _ in withAnimation { scrollReader.scrollTo(editor.selectedTab?.file.id) } diff --git a/CodeEdit/Features/Editor/Views/CodeFileView.swift b/CodeEdit/Features/Editor/Views/CodeFileView.swift index 2aa04497b6..f22f6cce3d 100644 --- a/CodeEdit/Features/Editor/Views/CodeFileView.swift +++ b/CodeEdit/Features/Editor/Views/CodeFileView.swift @@ -182,7 +182,7 @@ struct CodeFileView: View { .colorScheme(currentTheme.appearance == .dark ? .dark : .light) // minHeight zero fixes a bug where the app would freeze if the contents of the file are empty. .frame(minHeight: .zero, maxHeight: .infinity) - .onChange(of: settingsFont) { newFontSetting in + .onChange(of: settingsFont) { _, newFontSetting in font = newFontSetting.current } } diff --git a/CodeEdit/Features/Editor/Views/EditorAreaView.swift b/CodeEdit/Features/Editor/Views/EditorAreaView.swift index 00732c3058..f2659969c6 100644 --- a/CodeEdit/Features/Editor/Views/EditorAreaView.swift +++ b/CodeEdit/Features/Editor/Views/EditorAreaView.swift @@ -188,12 +188,12 @@ struct EditorAreaView: View { // editor.temporaryTab = nil // } // } - .onChange(of: navigationStyle) { newValue in + .onChange(of: navigationStyle) { _, newValue in if newValue == .openInPlace && editor.tabs.count == 1 { editor.temporaryTab = editor.tabs[0] } } - .onChange(of: editor.selectedTab) { newValue in + .onChange(of: editor.selectedTab) { _, newValue in if let file = newValue?.file.fileDocument { codeFile = { [weak file] in file } } diff --git a/CodeEdit/Features/InspectorArea/FileInspector/FileInspectorView.swift b/CodeEdit/Features/InspectorArea/FileInspector/FileInspectorView.swift index d4e6c10323..8a00ccb4b4 100644 --- a/CodeEdit/Features/InspectorArea/FileInspector/FileInspectorView.swift +++ b/CodeEdit/Features/InspectorArea/FileInspector/FileInspectorView.swift @@ -70,13 +70,13 @@ struct FileInspectorView: View { .onReceive(editorManager.activeEditor.objectWillChange) { _ in updateInspectorSource() } - .onChange(of: editorManager.activeEditor) { _ in + .onChange(of: editorManager.activeEditor) { _, _ in updateInspectorSource() } - .onChange(of: editorManager.activeEditor.selectedTab) { _ in + .onChange(of: editorManager.activeEditor.selectedTab) { _, _ in updateInspectorSource() } - .onChange(of: textEditing) { newValue in + .onChange(of: textEditing) { _, newValue in updateFileOptions(newValue) } } @@ -126,7 +126,7 @@ struct FileInspectorView: View { Text(language.id.rawValue.capitalized).tag(language as CodeLanguage?) } } - .onChange(of: language) { newValue in + .onChange(of: language) { _, newValue in file?.fileDocument?.language = newValue } } @@ -171,7 +171,7 @@ struct FileInspectorView: View { Text("Spaces").tag(SettingsData.TextEditingSettings.IndentOption.IndentType.spaces) Text("Tabs").tag(SettingsData.TextEditingSettings.IndentOption.IndentType.tab) } - .onChange(of: indentOption) { newValue in + .onChange(of: indentOption) { _, newValue in file?.fileDocument?.indentOption = newValue == textEditing.indentOption ? nil : newValue } } @@ -215,14 +215,14 @@ struct FileInspectorView: View { .help("The number of spaces to insert when the tab key is pressed.") } } - .onChange(of: defaultTabWidth) { newValue in + .onChange(of: defaultTabWidth) { _, newValue in file?.fileDocument?.defaultTabWidth = newValue == textEditing.defaultTabWidth ? nil : newValue } } private var wrapLinesToggle: some View { Toggle("Wrap lines", isOn: $wrapLines) - .onChange(of: wrapLines) { newValue in + .onChange(of: wrapLines) { _, newValue in file?.fileDocument?.wrapLines = newValue == textEditing.wrapLinesToEditorWidth ? nil : newValue } } diff --git a/CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorView.swift b/CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorView.swift index 280c00ffb5..9977683cab 100644 --- a/CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorView.swift +++ b/CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorView.swift @@ -49,12 +49,12 @@ struct HistoryInspectorView: View { await model.setFile(url: editorManager.activeEditor.selectedTab?.file.url.path()) } } - .onChange(of: editorManager.activeEditor) { _ in + .onChange(of: editorManager.activeEditor) { _, _ in Task { await model.setFile(url: editorManager.activeEditor.selectedTab?.file.url.path()) } } - .onChange(of: editorManager.activeEditor.selectedTab) { _ in + .onChange(of: editorManager.activeEditor.selectedTab) { _, _ in Task { await model.setFile(url: editorManager.activeEditor.selectedTab?.file.url.path()) } @@ -63,7 +63,7 @@ struct HistoryInspectorView: View { await model.setWorkspace(sourceControlManager: workspace.sourceControlManager) await model.setFile(url: editorManager.activeEditor.selectedTab?.file.url.path) } - .onChange(of: showMergeCommitsPerFileLog) { _ in + .onChange(of: showMergeCommitsPerFileLog) { _, _ in Task { await model.updateCommitHistory() } diff --git a/CodeEdit/Features/InspectorArea/Views/InspectorAreaView.swift b/CodeEdit/Features/InspectorArea/Views/InspectorAreaView.swift index ecfe7df841..61822a3b60 100644 --- a/CodeEdit/Features/InspectorArea/Views/InspectorAreaView.swift +++ b/CodeEdit/Features/InspectorArea/Views/InspectorAreaView.swift @@ -54,7 +54,7 @@ struct InspectorAreaView: View { .formStyle(.grouped) .accessibilityElement(children: .contain) .accessibilityLabel("inspector") - .onChange(of: showInternalDevelopmentInspector) { _ in + .onChange(of: showInternalDevelopmentInspector) { _, _ in updateTabs() } } diff --git a/CodeEdit/Features/LSP/Service/LSPService.swift b/CodeEdit/Features/LSP/Service/LSPService.swift index 8be58a3c58..373b951660 100644 --- a/CodeEdit/Features/LSP/Service/LSPService.swift +++ b/CodeEdit/Features/LSP/Service/LSPService.swift @@ -335,6 +335,8 @@ extension LSPService { private func notifyToInstallLanguageServer(language lspLanguage: LanguageIdentifier) { // TODO: Re-Enable when this is more fleshed out (don't send duplicate notifications in a session) return + // FIXME: Unreachable code - remove or re-enable when ready + /* let lspLanguageTitle = lspLanguage.rawValue.capitalized let notificationTitle = "Install \(lspLanguageTitle) Language Server" // Make sure the user doesn't have the same existing notification @@ -354,6 +356,7 @@ extension LSPService { // This will always read the default value and will not update self?.openWindow(sceneID: .settings) } + */ } } diff --git a/CodeEdit/Features/NavigatorArea/FindNavigator/FindNavigatorForm.swift b/CodeEdit/Features/NavigatorArea/FindNavigator/FindNavigatorForm.swift index baefe9d8cd..bb10b029b2 100644 --- a/CodeEdit/Features/NavigatorArea/FindNavigator/FindNavigatorForm.swift +++ b/CodeEdit/Features/NavigatorArea/FindNavigator/FindNavigatorForm.swift @@ -92,7 +92,7 @@ struct FindNavigatorForm: View { } ) .help("Match Case") - .onChange(of: caseSensitive) { newValue in + .onChange(of: caseSensitive) { _, newValue in state.caseSensitive = newValue } }, diff --git a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesCommitView.swift b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesCommitView.swift index acfa152ac7..bdc273160f 100644 --- a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesCommitView.swift +++ b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesCommitView.swift @@ -126,7 +126,7 @@ struct SourceControlNavigatorChangesCommitView: View { .padding(.top, 8) } .transition(.move(edge: .top)) - .onChange(of: message) { _ in + .onChange(of: message) { _, _ in withAnimation(.easeInOut(duration: 0.25)) { showDetails = !message.isEmpty } diff --git a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesList.swift b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesList.swift index 7872d0da2b..5aed2e3ced 100644 --- a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesList.swift +++ b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorChangesList.swift @@ -63,7 +63,7 @@ struct SourceControlNavigatorChangesList: View { } } ) - .onChange(of: selection) { newSelection in + .onChange(of: selection) { _, newSelection in if newSelection.count == 1, let file = newSelection.first { openGitFile(file) diff --git a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/History/Views/SourceControlNavigatorHistoryView.swift b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/History/Views/SourceControlNavigatorHistoryView.swift index b615763aa1..50898899f3 100644 --- a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/History/Views/SourceControlNavigatorHistoryView.swift +++ b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/History/Views/SourceControlNavigatorHistoryView.swift @@ -80,7 +80,7 @@ struct SourceControlNavigatorHistoryView: View { .onAppear { self.width = geometry.size.width } - .onChange(of: geometry.size.width) { newWidth in + .onChange(of: geometry.size.width) { _, newWidth in self.width = newWidth } } @@ -108,7 +108,7 @@ struct SourceControlNavigatorHistoryView: View { .task { await updateCommitHistory() } - .onChange(of: showMergeCommitsPerFileLog) { _ in + .onChange(of: showMergeCommitsPerFileLog) { _, _ in Task { await updateCommitHistory() } diff --git a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/ChangedFile/GitChangedFileListView.swift b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/ChangedFile/GitChangedFileListView.swift index a17e606ba0..989e43818f 100644 --- a/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/ChangedFile/GitChangedFileListView.swift +++ b/CodeEdit/Features/NavigatorArea/SourceControlNavigator/Views/ChangedFile/GitChangedFileListView.swift @@ -29,7 +29,7 @@ struct GitChangedFileListView: View { if showStaged { Toggle("", isOn: $staged) .labelsHidden() - .onChange(of: staged) { newStaged in + .onChange(of: staged) { _, newStaged in Task { if changedFile.isStaged != newStaged { if newStaged { @@ -51,7 +51,7 @@ struct GitChangedFileListView: View { } .listItemTint(listItemTint) .help(changedFile.fileURL.relativePath) - .onChange(of: changedFile.isStaged) { newStaged in + .onChange(of: changedFile.isStaged) { _, newStaged in staged = newStaged } } diff --git a/CodeEdit/Features/Notifications/Views/NotificationPanelView.swift b/CodeEdit/Features/Notifications/Views/NotificationPanelView.swift index c2c764eeb9..0474639a5f 100644 --- a/CodeEdit/Features/Notifications/Views/NotificationPanelView.swift +++ b/CodeEdit/Features/Notifications/Views/NotificationPanelView.swift @@ -89,7 +89,7 @@ struct NotificationPanelView: View { } .background( GeometryReader { proxy in - Color.clear.onChange(of: proxy.size.height) { newValue in + Color.clear.onChange(of: proxy.size.height) { _, newValue in contentHeight = newValue updateOverflow(contentHeight: newValue, containerHeight: geometry.size.height) } @@ -100,13 +100,13 @@ struct NotificationPanelView: View { .frame(height: min(geometry.size.height, contentHeight)) .scrollDisabled(!hasOverflow) .coordinateSpace(name: "scroll") - .onChange(of: isFocused) { newValue in + .onChange(of: isFocused) { _, newValue in workspace.notificationPanel.handleFocusChange(isFocused: newValue) } - .onChange(of: geometry.size.height) { newValue in + .onChange(of: geometry.size.height) { _, newValue in updateOverflow(contentHeight: contentHeight, containerHeight: newValue) } - .onChange(of: workspace.notificationPanel.isPresented) { isPresented in + .onChange(of: workspace.notificationPanel.isPresented) { _, isPresented in if !isPresented && !workspace.notificationPanel.scrolledToTop { // If scrolled, delay scroll animation until after notifications are hidden DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { @@ -133,12 +133,12 @@ struct NotificationPanelView: View { .focusable() .focusEffectDisabled() .focused($isFocused) - .onChange(of: workspace.notificationPanel.isPresented) { isPresented in + .onChange(of: workspace.notificationPanel.isPresented) { _, isPresented in if isPresented { isFocused = true } } - .onChange(of: controlActiveState) { newState in + .onChange(of: controlActiveState) { _, newState in if newState != .active && newState != .key && workspace.notificationPanel.isPresented { // Delay hiding notifications to match animation timing DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { diff --git a/CodeEdit/Features/Settings/Pages/AccountsSettings/AccountsSettingsDetailsView.swift b/CodeEdit/Features/Settings/Pages/AccountsSettings/AccountsSettingsDetailsView.swift index b4a02095df..52596cfcef 100644 --- a/CodeEdit/Features/Settings/Pages/AccountsSettings/AccountsSettingsDetailsView.swift +++ b/CodeEdit/Features/Settings/Pages/AccountsSettings/AccountsSettingsDetailsView.swift @@ -147,7 +147,7 @@ struct AccountsSettingsDetailsView: View { .padding(.top, 10) } } - .onChange(of: currentAccount) { newValue in + .onChange(of: currentAccount) { _, newValue in account = newValue } .navigationTitle(currentAccount.description) diff --git a/CodeEdit/Features/Settings/Pages/Extensions/LanguageServersView.swift b/CodeEdit/Features/Settings/Pages/Extensions/LanguageServersView.swift index aa1f1689cd..44cd02aafb 100644 --- a/CodeEdit/Features/Settings/Pages/Extensions/LanguageServersView.swift +++ b/CodeEdit/Features/Settings/Pages/Extensions/LanguageServersView.swift @@ -47,7 +47,7 @@ struct LanguageServersView: View { .listRowInsets(EdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8)) } .searchable(text: $searchText) - .onChange(of: searchText) { newValue in + .onChange(of: searchText) { _, newValue in searchModel.searchTextUpdated(searchText: newValue, allItems: registryManager.registryItems) } } header: { diff --git a/CodeEdit/Features/Settings/Pages/GeneralSettings/GeneralSettingsView.swift b/CodeEdit/Features/Settings/Pages/GeneralSettings/GeneralSettingsView.swift index 5b63327591..0dbc5cc6e7 100644 --- a/CodeEdit/Features/Settings/Pages/GeneralSettings/GeneralSettingsView.swift +++ b/CodeEdit/Features/Settings/Pages/GeneralSettings/GeneralSettingsView.swift @@ -86,7 +86,7 @@ private extension GeneralSettingsView { Text("Dark") .tag(SettingsData.Appearances.dark) } - .onChange(of: settings.appAppearance) { tag in + .onChange(of: settings.appAppearance) { _, tag in tag.applyAppearance() } } @@ -350,7 +350,7 @@ private extension GeneralSettingsView { var openInCodeEditToggle: some View { Toggle("Show “Open With CodeEdit” option in Finder", isOn: $openInCodeEdit) - .onChange(of: openInCodeEdit) { newValue in + .onChange(of: openInCodeEdit) { _, newValue in guard let defaults = UserDefaults.init( suiteName: "app.codeedit.CodeEdit.shared" ) else { diff --git a/CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift b/CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift index b0436366d6..7c9e9e70b7 100644 --- a/CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift +++ b/CodeEdit/Features/Settings/Pages/SourceControlSettings/SourceControlGitView.swift @@ -72,7 +72,7 @@ struct SourceControlGitView: View { private extension SourceControlGitView { private var gitAuthorName: some View { TextField("Author Name", text: $authorName) - .onChange(of: authorName) { newValue in + .onChange(of: authorName) { _, newValue in if hasAppeared { Limiter.debounce(id: "authorNameDebouncer", duration: 0.5) { Task { @@ -85,7 +85,7 @@ private extension SourceControlGitView { private var gitEmail: some View { TextField("Author Email", text: $authorEmail) - .onChange(of: authorEmail) { newValue in + .onChange(of: authorEmail) { _, newValue in if hasAppeared { Limiter.debounce(id: "authorEmailDebouncer", duration: 0.5) { Task { @@ -101,7 +101,7 @@ private extension SourceControlGitView { Text("Default branch name") Text("Cannot contain spaces, backslashes, or other symbols") } - .onChange(of: defaultBranch) { newValue in + .onChange(of: defaultBranch) { _, newValue in if hasAppeared { Limiter.debounce(id: "defaultBranchDebouncer", duration: 0.5) { Task { @@ -117,7 +117,7 @@ private extension SourceControlGitView { "Prefer to rebase when pulling", isOn: $preferRebaseWhenPulling ) - .onChange(of: preferRebaseWhenPulling) { newValue in + .onChange(of: preferRebaseWhenPulling) { _, newValue in if hasAppeared { Limiter.debounce(id: "pullRebaseDebouncer", duration: 0.5) { Task { diff --git a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsThemeToken.swift b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsThemeToken.swift index bc708c9c37..d02f2b912b 100644 --- a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsThemeToken.swift +++ b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsThemeToken.swift @@ -58,7 +58,7 @@ struct ThemeSettingsThemeToken: View { .onHover { hovering in isHovering = hovering } - .onChange(of: selectedColor) { newValue in + .onChange(of: selectedColor) { _, newValue in color = newValue } } diff --git a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift index 7ff0ceca7d..04c94db1b6 100644 --- a/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift +++ b/CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift @@ -116,13 +116,13 @@ struct ThemeSettingsView: View { .onAppear { updateFilteredThemes() } - .onChange(of: themeSearchQuery) { _ in + .onChange(of: themeSearchQuery) { _, _ in updateFilteredThemes() } - .onChange(of: themeModel.themes) { _ in + .onChange(of: themeModel.themes) { _, _ in updateFilteredThemes() } - .onChange(of: colorScheme) { newColorScheme in + .onChange(of: colorScheme) { _, newColorScheme in updateFilteredThemes(overrideColorScheme: newColorScheme) } } @@ -165,7 +165,7 @@ private extension ThemeSettingsView { "Automatically change theme based on system appearance", isOn: $settings.matchAppearance ) - .onChange(of: settings.matchAppearance) { value in + .onChange(of: settings.matchAppearance) { _, value in if value { if colorScheme == .dark { themeModel.selectedTheme = themeModel.selectedDarkTheme diff --git a/CodeEdit/Features/Settings/Views/GlobPatternListItem.swift b/CodeEdit/Features/Settings/Views/GlobPatternListItem.swift index 40e97a2da3..f6d4d91a3d 100644 --- a/CodeEdit/Features/Settings/Views/GlobPatternListItem.swift +++ b/CodeEdit/Features/Settings/Views/GlobPatternListItem.swift @@ -51,7 +51,7 @@ struct GlobPatternListItem: View { } } } - .onChange(of: isFocused) { newIsFocused in + .onChange(of: isFocused) { _, newIsFocused in if newIsFocused { if !selection.contains(pattern.id) { selection = [pattern.id] diff --git a/CodeEdit/Features/Settings/Views/MonospacedFontPicker.swift b/CodeEdit/Features/Settings/Views/MonospacedFontPicker.swift index bf6be50012..b6c2c91f9c 100644 --- a/CodeEdit/Features/Settings/Views/MonospacedFontPicker.swift +++ b/CodeEdit/Features/Settings/Views/MonospacedFontPicker.swift @@ -62,7 +62,7 @@ struct MonospacedFontPicker: View { } } } - .onChange(of: selectedFontName) { _ in + .onChange(of: selectedFontName) { _, _ in if selectedFontName != "SF Mono" { pushIntoRecentFonts(selectedFontName) diff --git a/CodeEdit/Features/Settings/Views/SettingsColorPicker.swift b/CodeEdit/Features/Settings/Views/SettingsColorPicker.swift index 453d2347d6..a3c80c9715 100644 --- a/CodeEdit/Features/Settings/Views/SettingsColorPicker.swift +++ b/CodeEdit/Features/Settings/Views/SettingsColorPicker.swift @@ -40,7 +40,7 @@ struct SettingsColorPicker: View where Content: View { .labelsHidden() } } - .onChange(of: selectedColor) { newValue in + .onChange(of: selectedColor) { _, newValue in color = newValue } } diff --git a/CodeEdit/Features/SourceControl/Views/RemoteBranchPicker.swift b/CodeEdit/Features/SourceControl/Views/RemoteBranchPicker.swift index c9ce62629a..165b5d3220 100644 --- a/CodeEdit/Features/SourceControl/Views/RemoteBranchPicker.swift +++ b/CodeEdit/Features/SourceControl/Views/RemoteBranchPicker.swift @@ -67,7 +67,7 @@ struct RemoteBranchPicker: View { updateRemote() } } - .onChange(of: remote) { newValue in + .onChange(of: remote) { _, newValue in if newValue == nil { sourceControlManager.addExistingRemoteSheetIsPresented = true } else { diff --git a/CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift b/CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift index 97f299bcc9..271141b721 100644 --- a/CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift +++ b/CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift @@ -57,7 +57,7 @@ struct UpdateStatusBarInfo: ViewModifier { statusBarViewModel.fileSize = statusBarInfo?.fileSize statusBarViewModel.dimensions = statusBarInfo?.dimensions } - .onChange(of: editorManager.activeEditor.selectedTab) { newTab in + .onChange(of: editorManager.activeEditor.selectedTab) { _, newTab in guard let newTab else { return } let statusBarInfo = computeStatusBarInfo(with: newTab.file.url) statusBarViewModel.fileSize = statusBarInfo?.fileSize diff --git a/CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift b/CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift index 1e5c2d15dd..c035241596 100644 --- a/CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift +++ b/CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift @@ -23,7 +23,7 @@ internal struct StatusBarToggleUtilityAreaButton: View { .keyboardShortcut("Y", modifiers: [.command, .shift]) .help(utilityAreaViewModel.isCollapsed ? "Show the Utility area" : "Hide the Utility area") .onHover { isHovering($0) } - .onChange(of: controlActiveState) { newValue in + .onChange(of: controlActiveState) { _, newValue in if newValue == .key { CommandManager.shared.addCommand( name: "Toggle Utility Area", diff --git a/CodeEdit/Features/Tasks/Views/StopTaskToolbarButton.swift b/CodeEdit/Features/Tasks/Views/StopTaskToolbarButton.swift index 559dbf0b77..0d4a7bcd98 100644 --- a/CodeEdit/Features/Tasks/Views/StopTaskToolbarButton.swift +++ b/CodeEdit/Features/Tasks/Views/StopTaskToolbarButton.swift @@ -43,8 +43,8 @@ struct StopTaskToolbarButton: View { .easeInOut(duration: 0.3), value: currentSelectedStatus ) - .onChange(of: taskManager.selectedTaskID) { _ in updateStatusListener() } - .onChange(of: taskManager.activeTasks) { _ in updateStatusListener() } + .onChange(of: taskManager.selectedTaskID) { _, _ in updateStatusListener() } + .onChange(of: taskManager.activeTasks) { _, _ in updateStatusListener() } .onAppear(perform: updateStatusListener) .onDisappear { statusListener?.cancel() diff --git a/CodeEdit/Features/UtilityArea/TerminalUtility/UtilityAreaTerminalSidebar.swift b/CodeEdit/Features/UtilityArea/TerminalUtility/UtilityAreaTerminalSidebar.swift index 4f72f5235b..1a9fb53ffe 100644 --- a/CodeEdit/Features/UtilityArea/TerminalUtility/UtilityAreaTerminalSidebar.swift +++ b/CodeEdit/Features/UtilityArea/TerminalUtility/UtilityAreaTerminalSidebar.swift @@ -48,7 +48,7 @@ struct UtilityAreaTerminalSidebar: View { } } } - .onChange(of: utilityAreaViewModel.terminals) { newValue in + .onChange(of: utilityAreaViewModel.terminals) { _, newValue in if newValue.isEmpty { utilityAreaViewModel.addTerminal(rootURL: workspace.fileURL) } diff --git a/CodeEdit/Features/WindowCommands/TasksCommands.swift b/CodeEdit/Features/WindowCommands/TasksCommands.swift index 5ea47e6fc5..ef067b30c8 100644 --- a/CodeEdit/Features/WindowCommands/TasksCommands.swift +++ b/CodeEdit/Features/WindowCommands/TasksCommands.swift @@ -38,7 +38,7 @@ struct TasksCommands: Commands { taskManager?.terminateActiveTask() } .keyboardShortcut(".") - .onChange(of: windowController) { _ in + .onChange(of: windowController) { _, _ in taskManagerListener = taskManager?.objectWillChange.sink { updateStatusListener() } diff --git a/CodeEdit/WorkspaceView.swift b/CodeEdit/WorkspaceView.swift index b52159d1ed..8c748555fe 100644 --- a/CodeEdit/WorkspaceView.swift +++ b/CodeEdit/WorkspaceView.swift @@ -58,10 +58,10 @@ struct WorkspaceView: View { // MARK: - Tab Focus Listeners - .onChange(of: editorManager.activeEditor) { newValue in + .onChange(of: editorManager.activeEditor) { _, newValue in focusedEditor = newValue } - .onChange(of: focusedEditor) { newValue in + .onChange(of: focusedEditor) { _, newValue in /// Update active tab group only if the new one is not the same with it. if let newValue, editorManager.activeEditor != newValue { editorManager.activeEditor = newValue @@ -73,7 +73,7 @@ struct WorkspaceView: View { .task { themeModel.colorScheme = colorScheme } - .onChange(of: colorScheme) { newValue in + .onChange(of: colorScheme) { _, newValue in themeModel.colorScheme = newValue if matchAppearance { themeModel.selectedTheme = newValue == .dark @@ -95,7 +95,7 @@ struct WorkspaceView: View { ) } } - .onChange(of: sourceControlIsEnabled) { newValue in + .onChange(of: sourceControlIsEnabled) { _, newValue in if newValue { Task { await sourceControlManager.refreshCurrentBranch() @@ -140,7 +140,7 @@ struct WorkspaceView: View { focus: $focusedEditor ) .frame(maxWidth: .infinity, maxHeight: .infinity) - .onChange(of: geo.size.height) { newHeight in + .onChange(of: geo.size.height) { _, newHeight in editorsHeight = newHeight } .onAppear { @@ -187,7 +187,7 @@ struct WorkspaceView: View { GeometryReader { geo in Rectangle() .opacity(0) - .onChange(of: geo.size.height) { newHeight in + .onChange(of: geo.size.height) { _, newHeight in drawerHeight = newHeight } .onAppear { From 0de7f9382fabea606299c95c41d93f94d3abc1df Mon Sep 17 00:00:00 2001 From: vksvicky Date: Tue, 2 Dec 2025 09:33:32 +0000 Subject: [PATCH 3/5] Fix: Additional onChange deprecation warnings - Fixed remaining onChange(of:perform:) calls that used explicit 'perform:' label - Updated onChange calls with capture lists to use new two-parameter syntax - Simplified capture list patterns as new onChange provides both old and new values Files fixed: - WorkspacePanelTabBar.swift - EditorTabButtonStyle.swift - EditorTabs.swift (2 instances) - ExtensionsListView.swift All onChange deprecation warnings now resolved. --- .../Views/WorkspacePanelTabBar.swift | 2 +- .../Tabs/Tab/EditorTabButtonStyle.swift | 4 ++-- .../Editor/TabBar/Tabs/Views/EditorTabs.swift | 20 +++++++++---------- .../Extensions/ExtensionsListView.swift | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift b/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift index 4e6ec36580..83053c8dd2 100644 --- a/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift +++ b/CodeEdit/Features/CodeEditUI/Views/WorkspacePanelTabBar.swift @@ -281,7 +281,7 @@ struct WorkspacePanelTabBar: View { self.tabWidth[tab] = (position == .top) ? geometry.size.width : geometry.size.height self.tabLocations[tab] = geometry.frame(in: .global) } - .onChange(of: geometry.frame(in: .global)) { newFrame in + .onChange(of: geometry.frame(in: .global)) { _, newFrame in self.tabLocations[tab] = newFrame } .onChange(of: geometry.size.width) { _, newWidth in diff --git a/CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabButtonStyle.swift b/CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabButtonStyle.swift index 6ecd2a964b..0c6364ec6b 100644 --- a/CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabButtonStyle.swift +++ b/CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabButtonStyle.swift @@ -19,8 +19,8 @@ struct EditorTabButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { configuration.label - .onChange(of: configuration.isPressed, perform: { isPressed in + .onChange(of: configuration.isPressed) { _, isPressed in self.isPressing = isPressed - }) + } } } diff --git a/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift b/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift index fe113b96d2..c2287c144e 100644 --- a/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift +++ b/CodeEdit/Features/Editor/TabBar/Tabs/Views/EditorTabs.swift @@ -223,17 +223,15 @@ struct EditorTabs: View { .frame(in: .global) } .onChange( - of: tabItemGeoReader.frame(in: .global), - perform: { tabCGRect in - tabLocations[id] = tabCGRect - } - ) + of: tabItemGeoReader.frame(in: .global) + ) { _, tabCGRect in + tabLocations[id] = tabCGRect + } .onChange( - of: tabItemGeoReader.size.width, - perform: { newWidth in - tabWidth[id] = newWidth - } - ) + of: tabItemGeoReader.size.width + ) { _, newWidth in + tabWidth[id] = newWidth + } } } @@ -313,7 +311,7 @@ struct EditorTabs: View { // On first tab appeared, jump to the corresponding position. scrollReader.scrollTo(editor.selectedTab) } - .onChange(of: editor.tabs) { [tabs = editor.tabs] newValue in + .onChange(of: editor.tabs) { tabs, newValue in if tabs.count == newValue.count { updateForTabCountChange(geometryProxy: geometryProxy) } else { diff --git a/CodeEdit/Features/Extensions/ExtensionsListView.swift b/CodeEdit/Features/Extensions/ExtensionsListView.swift index df42ebc236..3e79b87b95 100644 --- a/CodeEdit/Features/Extensions/ExtensionsListView.swift +++ b/CodeEdit/Features/Extensions/ExtensionsListView.swift @@ -43,7 +43,7 @@ struct ExtensionsListView: View { .frame(width: 400, height: 300) } } - .onChange(of: manager.extensions) { [oldValue = manager.extensions] newValue in + .onChange(of: manager.extensions) { oldValue, newValue in // Select the first one if previously the extension list was empty. if oldValue.isEmpty, let first = newValue.first { selection = [first] From d0d289348d8a95692a6a2f3b0302248639455ab6 Mon Sep 17 00:00:00 2001 From: vksvicky Date: Tue, 2 Dec 2025 09:34:48 +0000 Subject: [PATCH 4/5] Fix: Add required entitlements for file access The app was crashing with REPORT_APP_ENTITLEMENTS_INSUFFICIENT when trying to open file/folder dialogs from the Welcome screen. Added necessary entitlements: - com.apple.security.app-sandbox: Enable App Sandbox - com.apple.security.files.user-selected.read-write: Allow user-selected file access - com.apple.security.files.bookmarks.app-scope: Allow bookmark persistence - com.apple.security.network.client: Enable network access for extensions/LSP This resolves the crash when clicking "Open File or Folder" button. --- CodeEdit/CodeEdit.entitlements | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CodeEdit/CodeEdit.entitlements b/CodeEdit/CodeEdit.entitlements index c0c4f5e905..5c1489ef3b 100644 --- a/CodeEdit/CodeEdit.entitlements +++ b/CodeEdit/CodeEdit.entitlements @@ -2,6 +2,14 @@ + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.bookmarks.app-scope + + com.apple.security.network.client + com.apple.security.application-groups app.codeedit.CodeEdit.shared From dc53fb78eae4b98fa3ed0cee63bfac6c89ec6818 Mon Sep 17 00:00:00 2001 From: vksvicky Date: Tue, 2 Dec 2025 09:47:21 +0000 Subject: [PATCH 5/5] Fix: Memory leak in CurrentUser.getCurrentUser() Fixed memory leak where an UnsafeMutablePointer was allocated but never deallocated. Issue Analysis: - Line 43 was allocating heap memory for `result` pointer - getpwuid_r() immediately overwrites `result` to point to `pwd` (stack) - The allocated heap memory was leaked on every call - Attempting to deallocate crashed because `result` pointed to stack memory Root Cause: The allocation was unnecessary. getpwuid_r() expects `result` as an output parameter - it sets the pointer itself, no pre-allocation needed. Solution: Removed the unnecessary .allocate(capacity: 1) call. Now `result` is initialized as nil and getpwuid_r() sets it to point to `pwd` on success. This function is called every time a terminal is opened, so the leak would accumulate with each terminal session. --- CodeEdit/Features/TerminalEmulator/Model/CurrentUser.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeEdit/Features/TerminalEmulator/Model/CurrentUser.swift b/CodeEdit/Features/TerminalEmulator/Model/CurrentUser.swift index 33d5138590..78c3b706ca 100644 --- a/CodeEdit/Features/TerminalEmulator/Model/CurrentUser.swift +++ b/CodeEdit/Features/TerminalEmulator/Model/CurrentUser.swift @@ -39,8 +39,8 @@ struct CurrentUser { buffer.deallocate() } var pwd = passwd() - // points to `pwd` - var result: UnsafeMutablePointer? = UnsafeMutablePointer.allocate(capacity: 1) + // `result` will be set by getpwuid_r to point to `pwd` on success + var result: UnsafeMutablePointer? if getpwuid_r(getuid(), &pwd, buffer, bufsize, &result) != 0 { return nil }