before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/// This function deletes the item or folder from the current project by moving to Trash
/// - Parameters:
/// - file: The file or folder to delete
/// - Authors: Paul Ebose
public func trash(file: CEWorkspaceFile) {
if fileManager.fileExists(atPath: file.url.path) {
do {
... | We should put quotes around the file name. Make sure to use left quote and right quote characters. | /// This function deletes the item or folder from the current project by moving to Trash
/// - Parameters:
/// - file: The file or folder to delete
/// - Authors: Paul Ebose
public func trash(file: CEWorkspaceFile) {
if fileManager.fileExists(atPath: file.url.path) {
do {
... | @@ -129,30 +110,11 @@ extension CEWorkspaceFileManager {
public func delete(file: CEWorkspaceFile, confirmDelete: Bool = true) {
// This function also has to account for how the
// - file system can change outside of the editor
- let messageText: String
- let informativeText: String... | CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift | 26 | Swift | 0.286 | suggestion | 98 | 51 | 51 | false | delete warning message uses enumerator instead of shallow search | 1,699 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | knotbin | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift
PR Title: delete warning message uses enumerator instead of shallow search
BEFORE CODE: /// This function deletes the item or folder from the current project by moving to Trash... | We should put quotes around the file name. Make sure to use left quote and right quote characters. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// Created by Pavel Kasila on 20.03.22.
//
import AppKit
import AVKit
import CodeEditSourceEditor
import SwiftUI
struct EditorAreaFileView: View {
@EnvironmentObject private var editorManager: EditorManager
@EnvironmentObject private var editor: Editor
@Environment(\.edgeInsets)
private var edge... | Instead of reading the entire file into memory like this, would it work the same way to just check the document's `content` property for `isEmpty`? That would be a much more efficient operation, as this would potentially read a large file into memory quite often. | //
// Created by Pavel Kasila on 20.03.22.
//
import AppKit
import AVKit
import CodeEditSourceEditor
import SwiftUI
struct EditorAreaFileView: View {
@EnvironmentObject private var editorManager: EditorManager
@EnvironmentObject private var editor: Editor
@Environment(\.edgeInsets)
private var edge... | @@ -26,7 +26,7 @@ struct EditorAreaFileView: View {
@ViewBuilder var editorAreaFileView: some View {
if let document = file.fileDocument {
- if let utType = document.utType, utType.conforms(to: .text) {
+ if let fileURL = document.fileURL, (try? String(contentsOf: fileURL)) != nil ... | CodeEdit/Features/Editor/Views/EditorAreaFileView.swift | 26 | Swift | 0.786 | performance | 263 | 51 | 51 | false | Allow text files to be edited even when empty | 1,724 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Views/EditorAreaFileView.swift
PR Title: Allow text files to be edited even when empty
BEFORE CODE: //
// Created by Pavel Kasila on 20.03.22.
//
import AppKit
import AVKit
import CodeEditSourceEditor
import SwiftUI
struct EditorArea... | Instead of reading the entire file into memory like this, would it work the same way to just check the document's `content` property for `isEmpty`? That would be a much more efficient operation, as this would potentially read a large file into memory quite often. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@State private var bracketPairHighlight: BracketPairHighlight? = {
let theme = ThemeModel.shared.selectedTheme ?? ThemeModel.shared.themes.first!
let color = Settings[\.textEditing].bracketHighlight.useCustomColor
? Settings[\.textEditing].bracketHighlight.color.nsColor
: theme.edit... | What do you think about this approach? Then we will don't need this `sourceEditorText` anymore
```swift
CodeEditSourceEditor(
Binding(
get: { codeFile.content ?? "" },
set: { codeFile.content = $0 }
)
}
``` | return .flash
case .bordered:
return .bordered(color: color)
case .underline:
return .underline(color: color)
}
}()
@Environment(\.edgeInsets)
private var edgeInsets
@EnvironmentObject private var editor: Editor
var body: some View {
... | @@ -109,7 +115,7 @@ struct CodeFileView: View {
var body: some View {
CodeEditSourceEditor(
- $codeFile.content,
+ sourceEditorText, | CodeEdit/Features/Editor/Views/CodeFileView.swift | 26 | Swift | 0.786 | question | 255 | 51 | 51 | false | Allow text files to be edited even when empty | 1,724 | CodeEditApp/CodeEdit | 18,361 | Swift | markgravity | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Views/CodeFileView.swift
PR Title: Allow text files to be edited even when empty
BEFORE CODE:
@State private var bracketPairHighlight: BracketPairHighlight? = {
let theme = ThemeModel.shared.selectedTheme ?? ThemeModel.shar... | What do you think about this approach? Then we will don't need this `sourceEditorText` anymore
```swift
CodeEditSourceEditor(
Binding(
get: { codeFile.content ?? "" },
set: { codeFile.content = $0 }
)
}
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable {
var id: String { key }
let key: String
let value: String
}
private struct NewListTableItemView: View {
@State private var key = ""
@State private var value = ""
... | Could we use a `UUID` instead? | //
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable, Equatable {
let id = UUID()
let key: String
let value: String
}
private struct NewListTableItemView: View {
@Environment(\.dismiss)
var dismiss
@State private ... | @@ -0,0 +1,92 @@
+//
+// KeyValueTable.swift
+// CodeEdit
+//
+// Created by Abe Malla on 5/16/24.
+//
+
+import SwiftUI
+
+struct KeyValueItem: Identifiable {
+ var id: String { key } | CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift | 11 | Swift | 0.286 | question | 30 | 36 | 36 | false | Developer settings menu | 1,733 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | FastestMolasses | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift
PR Title: Developer settings menu
BEFORE CODE: //
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable {
var id: String { ke... | Could we use a `UUID` instead? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Text("Enter new key-value pair")
TextField("Key", text: $key)
.textFieldStyle(.roundedBorder)
TextField("Value", text: $value)
.textFieldStyle(.roundedBorder)
Button("Add") {
if !key.isEmpty && !value.isEmpty {
... | Could we use something more descriptive than `Key` and `Value`? | let keyColumnName: String
let valueColumnName: String
let newItemInstruction: String
let headerView: AnyView?
var completion: (String, String) -> Void
init(
_ keyColumnName: String,
_ valueColumnName: String,
_ newItemInstruction: String,
headerView: AnyView? = n... | @@ -0,0 +1,92 @@
+//
+// KeyValueTable.swift
+// CodeEdit
+//
+// Created by Abe Malla on 5/16/24.
+//
+
+import SwiftUI
+
+struct KeyValueItem: Identifiable {
+ var id: String { key }
+ let key: String
+ let value: String
+}
+
+private struct NewListTableItemView: View {
+ @State private var key = ""
+ ... | CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift | 26 | Swift | 0.429 | question | 63 | 51 | 51 | false | Developer settings menu | 1,733 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | FastestMolasses | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift
PR Title: Developer settings menu
BEFORE CODE: Text("Enter new key-value pair")
TextField("Key", text: $key)
.textFieldStyle(.roundedBorder)
TextField("Va... | Could we use something more descriptive than `Key` and `Value`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
SettingsPage(
.search,
baseColor: .blue,
icon: .system("magnifyingglass")
)
),
.init(
SettingsPage(
.sourceControl,
baseColor: .blue,
icon: .symbol("vault")
)
... | The flask reminds me more of tests or experimental settings. Could we use something different? As a side note, this shouldn't block the PR, just something to keep in mind. | .init(
SettingsPage(
.search,
baseColor: .blue,
icon: .system("magnifyingglass")
)
),
.init(
SettingsPage(
.sourceControl,
baseColor: .blue,
icon: .symbol("vault")
... | @@ -84,6 +84,14 @@ struct SettingsView: View {
baseColor: .green,
icon: .system("externaldrive.fill")
)
+ ),
+ // TODO: REMOVE THIS SECTION WHEN WE HAVE A SOLUTION FOR GETTING LSP BINARIES
+ .init(
+ SettingsPage(
+ .developer... | CodeEdit/Features/Settings/SettingsView.swift | 26 | Swift | 0.429 | suggestion | 171 | 51 | 51 | false | Developer settings menu | 1,733 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | FastestMolasses | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Settings/SettingsView.swift
PR Title: Developer settings menu
BEFORE CODE: SettingsPage(
.search,
baseColor: .blue,
icon: .system("magnifyingglass")
)
),
.... | The flask reminds me more of tests or experimental settings. Could we use something different? As a side note, this shouldn't block the PR, just something to keep in mind. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable {
var id: String { key }
let key: String
let value: String
}
private struct NewListTableItemView: View {
@State private var key = ""
@State private var value = ""
... | Could you provide better instructions on what to enter into the text fields, e.g., `path`? | //
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable, Equatable {
let id = UUID()
let key: String
let value: String
}
private struct NewListTableItemView: View {
@Environment(\.dismiss)
var dismiss
@State private ... | @@ -0,0 +1,92 @@
+//
+// KeyValueTable.swift
+// CodeEdit
+//
+// Created by Abe Malla on 5/16/24.
+//
+
+import SwiftUI
+
+struct KeyValueItem: Identifiable {
+ var id: String { key }
+ let key: String
+ let value: String
+}
+
+private struct NewListTableItemView: View {
+ @State private var key = ""
+ ... | CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift | 23 | Swift | 0.429 | question | 90 | 48 | 48 | false | Developer settings menu | 1,733 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | FastestMolasses | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CodeEditUI/Views/KeyValueTable.swift
PR Title: Developer settings menu
BEFORE CODE: //
// KeyValueTable.swift
// CodeEdit
//
// Created by Abe Malla on 5/16/24.
//
import SwiftUI
struct KeyValueItem: Identifiable {
var id: String { ke... | Could you provide better instructions on what to enter into the text fields, e.g., `path`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let command = "remote -v"
let output = try await run(command)
let remotes = parseGitRemotes(from: output)
return remotes
}
/// Add existing remote to local git
/// - Parameter name: Name for remote
/// - Parameter location: URL string for remote location
func addRem... | I'm definitely open to comments on this function. A few things I'm not 100% on:
1. Is my approach idiomatic Swift? Would a seasoned Swift programmer do it differently? (I am not a seasoned Swift programmer!) For example, the explicit `do / catch` construct feels a bit old skool; maybe you'd prefer `guard let remote ... | let command = "remote -v"
let output = try await run(command)
let remotes = parseGitRemotes(from: output)
return remotes
}
/// Add existing remote to local git
/// - Parameter name: Name for remote
/// - Parameter location: URL string for remote location
func addRem... | @@ -31,6 +31,20 @@ extension GitClient {
func removeRemote(name: String) async throws {
_ = try await run("remote rm \(name)")
}
+
+ /// Get the URL of the remote
+ /// > Note: If a git repository has multiple remotes, by default the `origin` remote
+ /// > will be used, unless there’s an up... | CodeEdit/Features/Git/Client/GitClient+Remote.swift | 26 | Swift | 0.643 | suggestion | 743 | 51 | 51 | false | Show Git history in the History Inspector, even when a remote is not configured | 1,744 | CodeEditApp/CodeEdit | 18,361 | Swift | simonwhitaker | simonwhitaker | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Git/Client/GitClient+Remote.swift
PR Title: Show Git history in the History Inspector, even when a remote is not configured
BEFORE CODE: let command = "remote -v"
let output = try await run(command)
let remotes = parseG... | I'm definitely open to comments on this function. A few things I'm not 100% on:
1. Is my approach idiomatic Swift? Would a seasoned Swift programmer do it differently? (I am not a seasoned Swift programmer!) For example, the explicit `do / catch` construct feels a bit old skool; maybe you'd prefer `guard let remote ... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// The weight of the custom font
var weight: NSFont.Weight = .medium
/// Default initializer
init() {}
/// Explicit decoder init for setting default values when key is not present in `JSON`
init(from decoder: Decoder) throws {
let container = try decoder.co... | Could you move these extensions to a separate file? Maybe call it `NSFont+WithWeight.swift` | //
// TextEditingPreferences.swift
// CodeEditModules/Settings
//
// Created by Nanashi Li on 2022/04/08.
//
import AppKit
import Foundation
extension SettingsData {
/// The global settings for text editing
struct TextEditingSettings: Codable, Hashable, SearchableSettingsPage {
var searchKeys: [S... | @@ -175,14 +179,66 @@ extension SettingsData {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.size = try container.decodeIfPresent(Double.self, forKey: .size) ?? size
self.name = try container.decodeIfPresent(String.self, forKey: .name) ?? name
+ s... | CodeEdit/Features/Settings/Pages/TextEditingSettings/Models/TextEditingSettings.swift | 26 | Swift | 0.429 | question | 91 | 51 | 195 | false | Added font weight pickers to text editing and terminal settings | 1,758 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | austincondiff | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Settings/Pages/TextEditingSettings/Models/TextEditingSettings.swift
PR Title: Added font weight pickers to text editing and terminal settings
BEFORE CODE: /// The weight of the custom font
var weight: NSFont.Weight = .medium
... | Could you move these extensions to a separate file? Maybe call it `NSFont+WithWeight.swift` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// QuickSearchResultLabel.swift
// CodeEdit
//
// Copyright © 2024-present Paul Ebose. All rights reserved.
//
import SwiftUI
/// Implementation of command palette entity. While swiftui does not allow to use NSMutableAttributeStrings,
/// the only way to fallback to UIKit and have NSViewRepresentable to be a br... | Due to the license of the project, we cannot include copyrighted code. Can we ask you resubmit a new implementation or a version without the notice? It needs to replace this commit entirely otherwise it will still be in the commit history. | //
// QuickSearchResultLabel.swift
// CodeEdit
//
// Created by Paul Ebose on 2024/7/2.
//
import SwiftUI
/// Implementation of command palette entity. While swiftui does not allow to use NSMutableAttributeStrings,
/// the only way to fallback to UIKit and have NSViewRepresentable to be a bridge between UIKit and ... | @@ -0,0 +1,52 @@
+//
+// QuickSearchResultLabel.swift
+// CodeEdit
+//
+// Copyright © 2024-present Paul Ebose. All rights reserved. | CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift | 5 | Swift | 0.5 | suggestion | 239 | 30 | 30 | false | highlight search query in 'Open Quickly' results | 1,790 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift
PR Title: highlight search query in 'Open Quickly' results
BEFORE CODE: //
// QuickSearchResultLabel.swift
// CodeEdit
//
// Copyright © 2024-present Paul Ebose. All rights reserved.
//
import Swif... | Due to the license of the project, we cannot include copyrighted code. Can we ask you resubmit a new implementation or a version without the notice? It needs to replace this commit entirely otherwise it will still be in the commit history. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// Highlights currently entered text query
struct QuickSearchResultLabel: NSViewRepresentable {
let labelName: String
let charactersToHighlight: [NSRange]
var nsLabelName: NSAttributedString?
public func makeNSView(context: Context) -> some NSTextField {
let label = NSTextField(wrappingLabelWi... | ```suggestion
attribText.addAttribute(.foregroundColor, value: NSColor.controlTextColor, range: range)
``` | /// Highlights currently entered text query
struct QuickSearchResultLabel: NSViewRepresentable {
let labelName: String
let charactersToHighlight: [NSRange]
var nsLabelName: NSAttributedString?
public func makeNSView(context: Context) -> some NSTextField {
let label = NSTextField(wrappingLabelWi... | @@ -0,0 +1,47 @@
+//
+// QuickSearchResultLabel.swift
+// CodeEdit
+//
+// Created by Paul Ebose on 2024/7/2.
+//
+
+import SwiftUI
+
+/// Implementation of command palette entity. While swiftui does not allow to use NSMutableAttributeStrings,
+/// the only way to fallback to UIKit and have NSViewRepresentable to be... | CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift | 26 | Swift | 0.714 | suggestion | 120 | 37 | 41 | false | highlight search query in 'Open Quickly' results | 1,790 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift
PR Title: highlight search query in 'Open Quickly' results
BEFORE CODE: /// Highlights currently entered text query
struct QuickSearchResultLabel: NSViewRepresentable {
let labelName: String
le... | ```suggestion
attribText.addAttribute(.foregroundColor, value: NSColor.controlTextColor, range: range)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let label = NSTextField(wrappingLabelWithString: labelName)
label.translatesAutoresizingMaskIntoConstraints = false
label.drawsBackground = false
label.textColor = .labelColor
label.isEditable = false
label.isSelectable = false
label.font = .labelFont(ofSize: 13)
... | ```suggestion
nsView.textColor = if nsLabelName == nil && charactersToHighlight.isEmpty {
.controlTextColor
} else {
.secondaryLabelColor
}
``` | let label = NSTextField(wrappingLabelWithString: labelName)
label.translatesAutoresizingMaskIntoConstraints = false
label.drawsBackground = false
label.textColor = .labelColor
label.isEditable = false
label.isSelectable = false
label.font = .labelFont(ofSize: 13)
... | @@ -0,0 +1,47 @@
+//
+// QuickSearchResultLabel.swift
+// CodeEdit
+//
+// Created by Paul Ebose on 2024/7/2.
+//
+
+import SwiftUI
+
+/// Implementation of command palette entity. While swiftui does not allow to use NSMutableAttributeStrings,
+/// the only way to fallback to UIKit and have NSViewRepresentable to be... | CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift | 26 | Swift | 0.714 | suggestion | 197 | 30 | 34 | false | highlight search query in 'Open Quickly' results | 1,790 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Search/Views/QuickSearchResultLabel.swift
PR Title: highlight search query in 'Open Quickly' results
BEFORE CODE: let label = NSTextField(wrappingLabelWithString: labelName)
label.translatesAutoresizingMaskIntoConstraints = fal... | ```suggestion
nsView.textColor = if nsLabelName == nil && charactersToHighlight.isEmpty {
.controlTextColor
} else {
.secondaryLabelColor
}
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// They can, however, be created standalone when necessary. Creating a standalone ``CEWorkspaceFile`` is useful if
/// loading all intermediate subdirectories (from the nearest cached parent to the file) has not been done yet and doing
/// so would be unnecessary.
///
/// An example of this is in the ``OpenQuicklyView... | This is not very efficient in my opinion... Instead of using `hasPrefix(".")`, we check `fileName.first == "."`. This is faster as it only checks the first character. | /// They can, however, be created standalone when necessary. Creating a standalone ``CEWorkspaceFile`` is useful if
/// loading all intermediate subdirectories (from the nearest cached parent to the file) has not been done yet and doing
/// so would be unnecessary.
///
/// An example of this is in the ``OpenQuicklyView... | @@ -42,7 +42,19 @@ final class CEWorkspaceFile: Codable, Comparable, Hashable, Identifiable, Editor
var name: String { url.lastPathComponent.trimmingCharacters(in: .whitespacesAndNewlines) }
/// Returns the extension of the file or an empty string if no extension is present.
- var type: FileIcon.FileType... | CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFile.swift | 26 | Swift | 0.571 | performance | 167 | 51 | 51 | false | Fix: Validate filenames consisting solely of extensions | 1,802 | CodeEditApp/CodeEdit | 18,361 | Swift | nanashili | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFile.swift
PR Title: Fix: Validate filenames consisting solely of extensions
BEFORE CODE: /// They can, however, be created standalone when necessary. Creating a standalone ``CEWorkspaceFile`` is useful if
/// loa... | This is not very efficient in my opinion... Instead of using `hasPrefix(".")`, we check `fileName.first == "."`. This is faster as it only checks the first character. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
self.tabs = []
self.parent = parent
files.forEach { openTab(file: $0) }
self.selectedTab = selectedTab ?? (files.isEmpty ? nil : Tab(file: files.first!))
self.temporaryTab = temporaryTab
}
init(
files: OrderedSet<Tab> = [],
selectedTab: Tab? = nil,
... | Which part in this function writes the changes to the file on disk? |
init(
files: OrderedSet<Tab> = [],
selectedTab: Tab? = nil,
temporaryTab: Tab? = nil,
parent: SplitViewData? = nil
) {
self.tabs = []
self.parent = parent
files.forEach { openTab(file: $0.file) }
self.selectedTab = selectedTab ?? tabs.first
... | @@ -106,22 +100,26 @@ final class Editor: ObservableObject, Identifiable {
/// Closes a tab in the editor.
/// This will also write any changes to the file on disk and will add the tab to the tab history. | CodeEdit/Features/Editor/Models/Editor.swift | 26 | Swift | 0.286 | question | 67 | 51 | 51 | false | Fix Navigator Key Navigation Explosion | 1,803 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Models/Editor.swift
PR Title: Fix Navigator Key Navigation Explosion
BEFORE CODE: self.tabs = []
self.parent = parent
files.forEach { openTab(file: $0) }
self.selectedTab = selectedTab ?? (files.isEmpty ?... | Which part in this function writes the changes to the file on disk? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
selectedTab = change.first
} else {
// Selected file was removed
if let selectedTab, change.contains(selectedTab) {
if let oldIndex = oldValue.firstIndex(of: selectedTab), oldIndex - 1 < tabs.count, !tabs.isEmpty {
s... | It would be awesome to use private(set) or fileprivate(set) here to keep things encapsulated, but since the extension is in a different file, it's not possible... | selectedTab = change.first
} else {
// Selected file was removed
if let selectedTab, change.contains(selectedTab) {
if let oldIndex = oldValue.firstIndex(of: selectedTab), oldIndex - 1 < tabs.count, !tabs.isEmpty {
s... | @@ -35,22 +35,16 @@ final class Editor: ObservableObject, Identifiable {
}
/// The current offset in the history list.
+ /// When set, updates the ``selectedTab`` to the tab indicated by the offset.
+ /// See the ``historyOffsetDidChange()`` method for more details.
@Published var historyOffset: ... | CodeEdit/Features/Editor/Models/Editor.swift | 26 | Swift | 0.429 | suggestion | 162 | 51 | 51 | false | Fix Navigator Key Navigation Explosion | 1,803 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Models/Editor.swift
PR Title: Fix Navigator Key Navigation Explosion
BEFORE CODE: selectedTab = change.first
} else {
// Selected file was removed
if let selectedTab, change.co... | It would be awesome to use private(set) or fileprivate(set) here to keep things encapsulated, but since the extension is in a different file, it's not possible... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
}
}
@IBAction func openQuickly(_ sender: Any?) {
if let workspace, let state = workspace.openQuicklyViewModel {
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
return
... | I don't think it's good practice to add child variables of an object to an environment?
Besides, you can always access them via the workspace environment variable.
Lastly, you're force unwrapping these variables, if they are `nil` for some reason, CodeEdit will fatally crash. | if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
return
} else {
window?.addChildWindow(quickOpenPanel, ordered: .above)
quickOpenPanel.makeKeyAndOrderFront(self)
... | @@ -151,7 +151,10 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
panel.close()
} openFile: { file in
workspace.editorManager?.openTab(item: file)
- }.environmentObject(workspace)
+ }
+ ... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | bug | 282 | 51 | 51 | false | Correctly view non-text files in single file window and Open Quickly | 1,820 | CodeEditApp/CodeEdit | 18,361 | Swift | matthijseikelenboom | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Correctly view non-text files in single file window and Open Quickly
BEFORE CODE: }
}
}
@IBAction func openQuickly(_ sender: Any?) {
if let wor... | I don't think it's good practice to add child variables of an object to an environment?
Besides, you can always access them via the workspace environment variable.
Lastly, you're force unwrapping these variables, if they are `nil` for some reason, CodeEdit will fatally crash. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if contentType.conforms(to: .image), let imageReps = NSImage(contentsOf: url)?.representations.first {
let dimensions = ImageDimensions(width: imageReps.pixelsWide, height: imageReps.pixelsHigh)
return ComputedStatusBarInfo(fileSize: fileSize, dimensions: dimensions)
} else { // ... | I don't know if we want this modifier applicable to every `View`
@thecoolwinter @Wouter01 Your opinion on this? | if contentType.conforms(to: .image), let imageReps = NSImage(contentsOf: fileURL)?.representations.first {
let dimensions = ImageDimensions(width: imageReps.pixelsWide, height: imageReps.pixelsHigh)
return ComputedStatusBarInfo(fileSize: fileSize, dimensions: dimensions)
} else {... | @@ -61,3 +65,9 @@ struct UpdateStatusBarInfo: ViewModifier {
}
}
+
+extension View { | CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift | 26 | Swift | 0.5 | question | 114 | 31 | 29 | false | Correctly view non-text files in single file window and Open Quickly | 1,820 | CodeEditApp/CodeEdit | 18,361 | Swift | matthijseikelenboom | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/StatusBar/ViewModifiers/UpdateStatusBarInfo.swift
PR Title: Correctly view non-text files in single file window and Open Quickly
BEFORE CODE: if contentType.conforms(to: .image), let imageReps = NSImage(contentsOf: url)?.representation... | I don't know if we want this modifier applicable to every `View`
@thecoolwinter @Wouter01 Your opinion on this? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// WindowCodeFileView.swift
// CodeEdit
//
// Created by Khan Winter on 3/19/23.
//
import Foundation
import SwiftUI
/// View that fixes [#1158](https://github.com/CodeEditApp/CodeEdit/issues/1158)
/// # Should **not** be used other than in a single file window.
struct WindowCodeFileView: View {
var codeFil... | For other reviewers, I remember these being used to avoid an endless loading screen for large files but can't reproduce it anymore. Might be CETV changes or changes related here but I think this change is fine. | //
// WindowCodeFileView.swift
// CodeEdit
//
// Created by Khan Winter on 3/19/23.
//
import Foundation
import SwiftUI
/// View that fixes [#1158](https://github.com/CodeEditApp/CodeEdit/issues/1158)
/// # Should **not** be used other than in a single file window.
struct WindowCodeFileView: View {
var codeFil... | CodeEdit/Features/Editor/Views/WindowCodeFileView.swift | 1 | Swift | 0.5 | suggestion | 210 | 26 | 24 | false | Correctly view non-text files in single file window and Open Quickly | 1,820 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | plbstl | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Views/WindowCodeFileView.swift
PR Title: Correctly view non-text files in single file window and Open Quickly
BEFORE CODE: //
// WindowCodeFileView.swift
// CodeEdit
//
// Created by Khan Winter on 3/19/23.
//
import Foundation
impo... | For other reviewers, I remember these being used to avoid an endless loading screen for large files but can't reproduce it anymore. Might be CETV changes or changes related here but I think this change is fine. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Button {
// TODO: #1874
} label: {
Text("Export All Custom Themes...")
}.disabled(true)
}
})
... | I'm getting a crash here whenever deleting a theme while searching. For example deleting the theme here without clearing the search field.

| Button {
// TODO: #1874
} label: {
Text("Export All Custom Themes...")
}.disabled(true)
}
})
... | @@ -18,85 +18,127 @@ struct ThemeSettingsView: View {
var useDarkTerminalAppearance
@State private var listView: Bool = false
+ @State private var themeSearchQuery: String = ""
+ @State private var filteredThemes: [Theme] = []
var body: some View {
- SettingsForm {
- Section {... | CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift | 26 | Swift | 0.5 | bug | 264 | 51 | 51 | false | feat(themes): Add fuzzy search for filtering and sorting themes in settings | 1,849 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | tom-ludwig | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Settings/Pages/ThemeSettings/ThemeSettingsView.swift
PR Title: feat(themes): Add fuzzy search for filtering and sorting themes in settings
BEFORE CODE: Button {
// TODO: #1874... | I'm getting a crash here whenever deleting a theme while searching. For example deleting the theme here without clearing the search field.

| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// - Parameter events: An array of events that occurred.
private func fileSystemEventReceived(events: [DirectoryEventStream.Event]) {
DispatchQueue.main.async {
var files: Set<CEWorkspaceFile> = []
for event in events {
// Event returns file/folder that was chang... | ```suggestion
self.logger.error(
"Failed to rebuild files for event: \(event.eventType.rawValue), path: \(event.path, privacy: .sensitive)"
)
``` | /// This method may be called on a background thread, but all work done by this function will be queued on the main
/// thread.
/// - Parameter events: An array of events that occurred.
private func fileSystemEventReceived(events: [DirectoryEventStream.Event]) {
DispatchQueue.main.async {
... | @@ -220,7 +222,12 @@ final class CEWorkspaceFileManager {
// TODO: Handle workspace root changing.
continue
case .itemCreated, .itemCloned, .itemRemoved, .itemRenamed:
- try? self.rebuildFiles(fromItem: parentItem)
+ do {
+... | CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager.swift | 26 | Swift | 0.929 | bug | 229 | 51 | 51 | false | Rebuild Cached Files After Rename, Git Status Label | 1,866 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager.swift
PR Title: Rebuild Cached Files After Rename, Git Status Label
BEFORE CODE: /// - Parameter events: An array of events that occurred.
private func fileSystemEventReceived(events: [Director... | ```suggestion
self.logger.error(
"Failed to rebuild files for event: \(event.eventType.rawValue), path: \(event.path, privacy: .sensitive)"
)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// CodeEditWindowController.swift
// CodeEdit
//
// Created by Pavel Kasila on 18.03.22.
//
import Cocoa
import SwiftUI
import Combine
final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, ObservableObject, NSWindowDelegate {
@Published var navigatorCollapsed = false
@Published va... | You might call this "panelOpen".
```suggestion
private var panelOpen = false
``` | //
// CodeEditWindowController.swift
// CodeEdit
//
// Created by Pavel Kasila on 18.03.22.
//
import Cocoa
import SwiftUI
import Combine
final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, ObservableObject, NSWindowDelegate {
@Published var navigatorCollapsed = false
@Published va... | @@ -14,6 +14,8 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
@Published var inspectorCollapsed = false
@Published var toolbarCollapsed = false
+ private var modalOpen = false | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 17 | Swift | 0.571 | suggestion | 89 | 42 | 42 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: //
// CodeEditWindowController.swift
// CodeEdit
//
// Created by Pavel Kasila on 1... | You might call this "panelOpen".
```suggestion
private var panelOpen = false
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let navigatorModel = NavigatorSidebarViewModel()
navigatorSidebarViewModel = navigatorModel
self.listenToDocumentEdited(workspace: workspace)
return CodeEditSplitViewController(
workspace: workspace,
navigatorViewModel: navigatorModel,
windowRef: windo... | ```suggestion
self.panelOpen = false
``` | let navigatorModel = NavigatorSidebarViewModel()
navigatorSidebarViewModel = navigatorModel
self.listenToDocumentEdited(workspace: workspace)
return CodeEditSplitViewController(
workspace: workspace,
navigatorViewModel: navigatorModel,
windowRef: windo... | @@ -109,20 +111,26 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
+ self.modalOpen = false | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 62 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: let navigatorModel = NavigatorSidebarViewModel()
navigatorSidebarViewM... | ```suggestion
self.panelOpen = false
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
)
}
private func getSelectedCodeFile() -> CodeFileDocument? {
workspace?.editorManager?.activeEditor.selectedTab?.file.fileDocument
}
@IBAction func saveDocument(_ sender: Any) {
guard let codeFile = getSelectedCodeFile() else { return }
codeFile.save(sender)
wo... | ```suggestion
self.panelOpen = true
``` | )
}
private func getSelectedCodeFile() -> CodeFileDocument? {
workspace?.editorManager?.activeEditor.selectedTab?.file.fileDocument
}
@IBAction func saveDocument(_ sender: Any) {
guard let codeFile = getSelectedCodeFile() else { return }
codeFile.save(sender)
wo... | @@ -109,20 +111,26 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
+ self.modalOpen = false
state.r... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 61 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: )
}
private func getSelectedCodeFile() -> CodeFileDocument? {
... | ```suggestion
self.panelOpen = true
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@IBAction func saveDocument(_ sender: Any) {
guard let codeFile = getSelectedCodeFile() else { return }
codeFile.save(sender)
workspace?.editorManager?.activeEditor.temporaryTab = nil
}
@IBAction func openCommandPalette(_ sender: Any) {
if let workspace, let state = workspac... | ```suggestion
self.panelOpen = false
``` | @IBAction func saveDocument(_ sender: Any) {
guard let codeFile = getSelectedCodeFile() else { return }
codeFile.save(sender)
workspace?.editorManager?.activeEditor.temporaryTab = nil
}
@IBAction func openCommandPalette(_ sender: Any) {
if let workspace, let state = workspac... | @@ -109,20 +111,26 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
+ self.modalOpen = false
state.r... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 62 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: @IBAction func saveDocument(_ sender: Any) {
guard let codeFile = getSelec... | ```suggestion
self.panelOpen = false
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@IBAction func openCommandPalette(_ sender: Any) {
if let workspace, let state = workspace.commandsPaletteState {
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
self.modalOpen = false
... | ```suggestion
self.panelOpen = true
``` |
@IBAction func openCommandPalette(_ sender: Any) {
if let workspace, let state = workspace.commandsPaletteState {
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
self.panelOpen = false
... | @@ -109,20 +111,26 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let commandPalettePanel {
if commandPalettePanel.isKeyWindow {
commandPalettePanel.close()
+ self.modalOpen = false
state.r... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 57 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE:
@IBAction func openCommandPalette(_ sender: Any) {
if let workspace, let ... | ```suggestion
self.panelOpen = true
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
state.reset()
window?.addChildWindow(commandPalettePanel, ordered: .above)
commandPalettePanel.makeKeyAndOrderFront(self)
self.modalOpen = true
}
} else {
let panel = SearchPanel()
... | ```suggestion
self.panelOpen = false
``` | state.reset()
window?.addChildWindow(commandPalettePanel, ordered: .above)
commandPalettePanel.makeKeyAndOrderFront(self)
self.panelOpen = true
}
} else {
let panel = SearchPanel()
... | @@ -132,29 +140,34 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
+ self.modalOpen = false | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 62 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: state.reset()
window?.addChildWindow(commandPa... | ```suggestion
self.panelOpen = false
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} else {
let panel = SearchPanel()
self.commandPalettePanel = panel
let contentView = QuickActionsView(state: state) {
panel.close()
self.modalOpen = false
}
panel.contentView = NSHostingV... | ```suggestion
self.panelOpen = true
``` | } else {
let panel = SearchPanel()
self.commandPalettePanel = panel
let contentView = QuickActionsView(state: state) {
panel.close()
self.panelOpen = false
}
panel.contentView = NSHostingV... | @@ -132,29 +140,34 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
+ self.modalOpen = false
return
... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 61 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: } else {
let panel = SearchPanel()
self.co... | ```suggestion
self.panelOpen = true
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
window?.addChildWindow(panel, ordered: .above)
panel.makeKeyAndOrderFront(self)
self.modalOpen = true
}
}
}
@IBAction func openQuickly(_ sender: Any?) {
if let workspace, let state = workspace.openQuicklyViewModel {
if let ... | ```suggestion
self.panelOpen = false
``` | window?.addChildWindow(panel, ordered: .above)
panel.makeKeyAndOrderFront(self)
self.panelOpen = true
}
}
}
@IBAction func openQuickly(_ sender: Any?) {
if let workspace, let state = workspace.openQuicklyViewModel {
if let ... | @@ -132,29 +140,34 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
+ self.modalOpen = false
return
... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 62 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: window?.addChildWindow(panel, ordered: .above)
panel.m... | ```suggestion
self.panelOpen = false
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if let workspace, let state = workspace.openQuicklyViewModel {
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
self.modalOpen = false
return
} else {
window?... | ```suggestion
self.panelOpen = true
``` | if let workspace, let state = workspace.openQuicklyViewModel {
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
self.panelOpen = false
return
} else {
window?... | @@ -132,29 +140,34 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
+ self.modalOpen = false
return
... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 57 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: if let workspace, let state = workspace.openQuicklyViewModel {
if ... | ```suggestion
self.panelOpen = true
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} else {
window?.addChildWindow(quickOpenPanel, ordered: .above)
quickOpenPanel.makeKeyAndOrderFront(self)
self.modalOpen = true
}
} else {
let panel = SearchPanel()
self.quickOpenPane... | ```suggestion
if self.panelOpen { return }
``` | } else {
window?.addChildWindow(quickOpenPanel, ordered: .above)
quickOpenPanel.makeKeyAndOrderFront(self)
self.panelOpen = true
}
} else {
let panel = SearchPanel()
self.quickOpenPane... | @@ -132,29 +140,34 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
if let quickOpenPanel {
if quickOpenPanel.isKeyWindow {
quickOpenPanel.close()
+ self.modalOpen = false
return
... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 26 | Swift | 0.571 | suggestion | 56 | 51 | 51 | false | Closing tabs while Open Quickly or Command Palette is open is no longer allowed. | 1,868 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | scaredcr6w | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Closing tabs while Open Quickly or Command Palette is open is no longer allowed.
BEFORE CODE: } else {
window?.addChildWindow(quickOpenPanel, or... | ```suggestion
if self.panelOpen { return }
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// Terminates running language servers. Used during app termination to ensure resources are freed.
private func terminateLanguageServers() {
Task {
await withTaskGroup(of: Void.self) { group in
await lspService.languageClients.forEach { (key, value) in
g... | All tasks should be terminated, not just the active one. `stopAllTasks()` currently sends a `SIGINT`, but we should consider sending a `SIGTERM`.
```suggestion
workspace.taskManager?.stopAllTasks()
``` |
/// Terminates running language servers. Used during app termination to ensure resources are freed.
private func terminateLanguageServers() {
Task {
await lspService.stopAllServers()
await MainActor.run {
NSApplication.shared.reply(toApplicationShouldTerminate: t... | @@ -224,7 +245,38 @@ final class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
@objc
func documentController(_ docController: NSDocumentController, didCloseAll: Bool, contextInfo: Any) {
- NSApplication.shared.reply(toApplicationShouldTerminate: didCloseAll)
+ if didCloseAll... | CodeEdit/AppDelegate.swift | 26 | Swift | 0.857 | suggestion | 216 | 42 | 32 | false | Clean Up Child Processes | 1,885 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/AppDelegate.swift
PR Title: Clean Up Child Processes
BEFORE CODE:
/// Terminates running language servers. Used during app termination to ensure resources are freed.
private func terminateLanguageServers() {
Task {
await wi... | All tasks should be terminated, not just the active one. `stopAllTasks()` currently sends a `SIGINT`, but we should consider sending a `SIGTERM`.
```suggestion
workspace.taskManager?.stopAllTasks()
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
self?.checkForFilesToOpen()
}
}
/// Enable window size restoring on app relaunch after quitting.
private func enableWindowSizeSaveOnQuit() {
// This enables window restoring on normal quit (instead of o... | The LSP Service already has a function to stop all the language servers | DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
self?.checkForFilesToOpen()
}
}
/// Enable window size restoring on app relaunch after quitting.
private func enableWindowSizeSaveOnQuit() {
// This enables window restoring on normal quit (instead of o... | @@ -224,7 +245,38 @@ final class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
@objc
func documentController(_ docController: NSDocumentController, didCloseAll: Bool, contextInfo: Any) {
- NSApplication.shared.reply(toApplicationShouldTerminate: didCloseAll)
+ if didCloseAll... | CodeEdit/AppDelegate.swift | 26 | Swift | 0.214 | suggestion | 71 | 51 | 51 | false | Clean Up Child Processes | 1,885 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/AppDelegate.swift
PR Title: Clean Up Child Processes
BEFORE CODE: DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
self?.checkForFilesToOpen()
}
}
/// Enable window size restoring on app relaunch... | The LSP Service already has a function to stop all the language servers | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import Foundation
extension WorkspaceDocument {
final class SearchState: ObservableObject {
enum IndexStatus: Equatable {
case none
case indexing(progress: Double)
case done
}
enum FindNavigatorStatus: Equatable {
case none
case ... | ```suggestion
/// Stores the user's input, shown when no files are found, and persists across navigation items.
``` |
import Foundation
extension WorkspaceDocument {
final class SearchState: ObservableObject {
enum IndexStatus: Equatable {
case none
case indexing(progress: Double)
case done
}
enum FindNavigatorStatus: Equatable {
case none
case ... | @@ -29,6 +29,7 @@ extension WorkspaceDocument {
@Published var searchResultsCount: Int = 0
/// searchQuery stands for the last search query that corresponds to the search results
/// At the time it's only purpose is to show the query if no files could be found
+ /// searchQuery persist... | CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceDocument+SearchState.swift | 26 | Swift | 0.786 | suggestion | 125 | 51 | 51 | false | Fix search text disappearance on changing navigation item | 1,889 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | karan0046 | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceDocument+SearchState.swift
PR Title: Fix search text disappearance on changing navigation item
BEFORE CODE:
import Foundation
extension WorkspaceDocument {
final class SearchState: ObservableObject {
... | ```suggestion
/// Stores the user's input, shown when no files are found, and persists across navigation items.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
self.temporaryTab = temporaryTab
}
/// Closes the editor.
func close() {
parent?.closeEditor(with: id)
}
/// Gets the editor layout.
func getEditorLayout() -> EditorLayout? {
return parent?.getEditorLayout(with: id)
}
/// Set the selected tab. Loads the file's ... | ```suggestion
do { // Ignore this error for simpler API usage.
| self.temporaryTab = temporaryTab
}
/// Closes the editor.
func close() {
parent?.closeEditor(with: id)
}
/// Gets the editor layout.
func getEditorLayout() -> EditorLayout? {
return parent?.getEditorLayout(with: id)
}
/// Set the selected tab. Loads the file's ... | @@ -98,6 +98,26 @@ final class Editor: ObservableObject, Identifiable {
return parent?.getEditorLayout(with: id)
}
+ /// Set the selected tab. Loads the file's contents if it hasn't already been opened.
+ /// - Parameter file: The file to set as the selected tab.
+ func setSelectedTab(_ file: C... | CodeEdit/Features/Editor/Models/Editor.swift | 26 | Swift | 0.714 | suggestion | 77 | 51 | 51 | false | EditorManager Always Opens Files | 1,892 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/Models/Editor.swift
PR Title: EditorManager Always Opens Files
BEFORE CODE: self.temporaryTab = temporaryTab
}
/// Closes the editor.
func close() {
parent?.closeEditor(with: id)
}
/// Gets the edit... | ```suggestion
do { // Ignore this error for simpler API usage.
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// WorkspaceDocument.swift
// CodeEdit
//
// Created by Pavel Kasila on 17.03.22.
//
import AppKit
import SwiftUI
import Combine
import Foundation
import LanguageServerProtocol
@objc(WorkspaceDocument)
final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
@Published var sortFolder... | This should be renamed to something a little more descriptive. Maybe `fileFilter`? Also a doc comment here explaining that this is for the project navigator would make this okay. | //
// WorkspaceDocument.swift
// CodeEdit
//
// Created by Pavel Kasila on 17.03.22.
//
import AppKit
import SwiftUI
import Combine
import Foundation
import LanguageServerProtocol
@objc(WorkspaceDocument)
final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
@Published var sortFolder... | @@ -14,6 +14,7 @@ import LanguageServerProtocol
@objc(WorkspaceDocument)
final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
@Published var sortFoldersOnTop: Bool = true
+ @Published var filter: String = "" | CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceDocument.swift | 17 | Swift | 0.571 | suggestion | 178 | 42 | 42 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceDocument.swift
PR Title: Project navigator file filtering
BEFORE CODE: //
// WorkspaceDocument.swift
// CodeEdit
//
// Created by Pavel Kasila on 17.03.22.
//
import AppKit
import SwiftUI
import Combine... | This should be renamed to something a little more descriptive. Maybe `fileFilter`? Also a doc comment here explaining that this is for the project navigator would make this okay. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// StandardTableViewCell.swift
// CodeEdit
//
// Created by TAY KAI QUAN on 17/8/22.
//
import SwiftUI
class StandardTableViewCell: NSTableCellView {
weak var secondaryLabel: NSTextField?
var workspace: WorkspaceDocument?
var secondaryLabelRightAligned: Bool = true {
didSet {
r... | Leaving out `weak` here worries me. I don't think this view should need to strongly reference the workspace object. | //
// StandardTableViewCell.swift
// CodeEdit
//
// Created by TAY KAI QUAN on 17/8/22.
//
import SwiftUI
class StandardTableViewCell: NSTableCellView {
weak var secondaryLabel: NSTextField?
weak var workspace: WorkspaceDocument?
var secondaryLabelRightAligned: Bool = true {
didSet {
... | @@ -10,7 +10,7 @@ import SwiftUI
class StandardTableViewCell: NSTableCellView {
weak var secondaryLabel: NSTextField?
- weak var workspace: WorkspaceDocument?
+ var workspace: WorkspaceDocument? | CodeEdit/Features/NavigatorArea/OutlineView/StandardTableViewCell.swift | 13 | Swift | 0.571 | suggestion | 115 | 38 | 38 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/OutlineView/StandardTableViewCell.swift
PR Title: Project navigator file filtering
BEFORE CODE: //
// StandardTableViewCell.swift
// CodeEdit
//
// Created by TAY KAI QUAN on 17/8/22.
//
import SwiftUI
class StandardTableVie... | Leaving out `weak` here worries me. I don't think this view should need to strongly reference the workspace object. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
func outlineViewSelectionDidChange(_ notification: Notification) {
guard let outlineView = notification.object as? NSOutlineView else { return }
let selectedIndex = outlineView.selectedRow
guard let item = outlineView.item(atRow: selectedIndex) as? CEWorkspaceFile else { return }
... | I notice you use the `workspace.filter` property over the navigator's `filter` property. Why don't we remove the navigator's filter property and just use the workspace one.
The publisher would also allow for adding a throttle to the filter changes which might help responsiveness.
```swift
private var filterListene... | }
func outlineViewSelectionDidChange(_ notification: Notification) {
guard let outlineView = notification.object as? NSOutlineView else { return }
let selectedIndex = outlineView.selectedRow
guard let item = outlineView.item(atRow: selectedIndex) as? CEWorkspaceFile else { return }
... | @@ -49,8 +54,14 @@ extension ProjectNavigatorViewController: NSOutlineViewDelegate {
}
func outlineViewItemDidExpand(_ notification: Notification) {
- guard let id = workspace?.editorManager?.activeEditor.selectedTab?.file.id,
- let item = workspace?.workspaceFileManager?.getFile(id, cre... | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController+NSOutlineViewDelegate.swift | 26 | Swift | 1 | nitpick | 617 | 51 | 51 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController+NSOutlineViewDelegate.swift
PR Title: Project navigator file filtering
BEFORE CODE: }
func outlineViewSelectionDidChange(_ notification: Notification) {
... | I notice you use the `workspace.filter` property over the navigator's `filter` property. Why don't we remove the navigator's filter property and just use the workspace one.
The publisher would also allow for adding a throttle to the filter changes which might help responsiveness.
```swift
private var filterListene... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// Expand or collapse the folder on double click
@objc
private func onItemDoubleClicked() {
guard let item = outlineView.item(atRow: outlineView.clickedRow) as? CEWorkspaceFile else { return }
if item.isFolder {
if outlineView.isItemExpanded(item) {
outlineView.... | One more thing for the expanded state, if the user closes the app before the expanded state can be restored, all folders will now be expanded when the user opens the app again.
We should disable expansion state restoration when the filter is active, just using `outlineView.autosaveExpandedItems = false/true`. That s... | if item.isFolder {
if outlineView.isItemExpanded(item) {
outlineView.collapseItem(item)
} else {
outlineView.expandItem(item)
}
} else if Settings[\.navigation].navigationStyle == .openInTabs {
workspace?.editorManager?.acti... | @@ -155,5 +186,78 @@ final class ProjectNavigatorViewController: NSViewController {
}
}
- // TODO: File filtering
+ private func handleFilterChange() {
+ filteredContentChildren.removeAll()
+ outlineView.reloadData()
+ | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift | 26 | Swift | 0.643 | suggestion | 435 | 51 | 51 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift
PR Title: Project navigator file filtering
BEFORE CODE: /// Expand or collapse the folder on double click
@objc
private func onItemDoubleClicked() {
... | One more thing for the expanded state, if the user closes the app before the expanded state can be restored, all folders will now be expanded when the user opens the app again.
We should disable expansion state restoration when the filter is active, just using `outlineView.autosaveExpandedItems = false/true`. That s... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// - frameRect: The frame of the cell.
/// - item: The file item the cell represents.
/// - isEditable: Set to true if the user should be able to edit the file name.
init(frame frameRect: NSRect, item: CEWorkspaceFile?, isEditable: Bool = true, workspace: WorkspaceDocument?) {
super.init(... | This cell class is used outside of the project navigator. Instead of grabbing the filter from the workspace, lets add an optional filter property and set it from the project navigator. That'll prevent the filter style from leaking into other UI elements like the search list. | /// - Parameters:
/// - frameRect: The frame of the cell.
/// - item: The file item the cell represents.
/// - isEditable: Set to true if the user should be able to edit the file name.
/// - navigatorFilter: An optional string use to filter the navigator area.
/// (U... | @@ -40,7 +40,52 @@ class FileSystemTableViewCell: StandardTableViewCell {
fileItem = item
imageView?.image = item.nsIcon
imageView?.contentTintColor = color(for: item)
- textField?.stringValue = item.labelFileName()
+
+ let fileName = item.labelFileName()
+
+ // Apply bol... | CodeEdit/Features/NavigatorArea/OutlineView/FileSystemTableViewCell.swift | 26 | Swift | 0.643 | suggestion | 275 | 51 | 51 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/OutlineView/FileSystemTableViewCell.swift
PR Title: Project navigator file filtering
BEFORE CODE: /// - frameRect: The frame of the cell.
/// - item: The file item the cell represents.
/// - isEditable: Set to t... | This cell class is used outside of the project navigator. Instead of grabbing the filter from the workspace, lets add an optional filter property and set it from the project navigator. That'll prevent the filter style from leaking into other UI elements like the search list. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
func addIcon(item: CEWorkspaceFile) {
fileItem = item
imageView?.image = item.nsIcon
imageView?.contentTintColor = color(for: item)
let fileName = item.labelFileName()
// Apply bold style if the filename matches the workspace filter
if let filter = workspace?.filter... | ```suggestion
.foregroundColor: NSColor.labelColor
```
Fixes this selection color bug:


label.delegate = self
}
func addIcon(item: CEWorkspaceFile) {
fileItem = item
imageView?.image = item.nsIcon
imageView?.contentTintColor = color(for: item)
let fileName = item.labelFileName()
guard... | @@ -40,7 +40,52 @@ class FileSystemTableViewCell: StandardTableViewCell {
fileItem = item
imageView?.image = item.nsIcon
imageView?.contentTintColor = color(for: item)
- textField?.stringValue = item.labelFileName()
+
+ let fileName = item.labelFileName()
+
+ // Apply bol... | CodeEdit/Features/NavigatorArea/OutlineView/FileSystemTableViewCell.swift | 26 | Swift | 1 | bug | 337 | 51 | 51 | false | Project navigator file filtering | 1,896 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/OutlineView/FileSystemTableViewCell.swift
PR Title: Project navigator file filtering
BEFORE CODE: func addIcon(item: CEWorkspaceFile) {
fileItem = item
imageView?.image = item.nsIcon
imageView?.content... | ```suggestion
.foregroundColor: NSColor.labelColor
```
Fixes this selection color bug:


deleteConfirmation.messageText = "Do you want to delete “\(fileName)”?"
deleteConfirmation.informativeText = "This item will be deleted immediately. You can't undo this action."
deleteConfirmation.alertStyle = .critical
deleteConfirmation.addBut... | This is what Finder says when you try to delete multiple items immediately (I couldn't figure out how to delete files immediately in Xocde).
```suggestion
deleteConfirmation.messageText = "Are you sure you want to delete the \(files.count) selected items?"
deleteConfirmation.informativeText = "\(file... | let deleteConfirmation = NSAlert()
deleteConfirmation.messageText = "Do you want to delete “\(fileName)”?"
deleteConfirmation.informativeText = "This item will be deleted immediately. You can't undo this action."
deleteConfirmation.alertStyle = .critical
deleteConfirmation.addBut... | @@ -141,6 +141,29 @@ extension CEWorkspaceFileManager {
}
}
+ /// This function deletes multiple files or folders from the current project by erasing immediately.
+ /// - Parameters:
+ /// - files: The files to delete
+ /// - confirmDelete: True to present an alert to confirm the delete.... | CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift | 26 | Swift | 0.857 | suggestion | 398 | 51 | 51 | false | Select multiple files in the project navigator | 1,906 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift
PR Title: Select multiple files in the project navigator
BEFORE CODE: let deleteConfirmation = NSAlert()
deleteConfirmation.messageText = "Do you want to delete “\(... | This is what Finder says when you try to delete multiple items immediately (I couldn't figure out how to delete files immediately in Xocde).
```suggestion
deleteConfirmation.messageText = "Are you sure you want to delete the \(files.count) selected items?"
deleteConfirmation.informativeText = "\(file... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
reloadData()
sender.outlineView.expandItem(item.isFolder ? item : item.parent)
}
// TODO: allow custom folder names
/// Action that creates a new untitled folder
@objc
func newFolder() {
guard let item else { return }
workspace?.workspaceFileManager?.addFol... | ```suggestion
var newFolderURL = parent.url.appendingPathComponent("New Folder With Items", conformingTo: .folder)
``` | }
reloadData()
sender.outlineView.expandItem(item.isFolder ? item : item.parent)
}
// TODO: allow custom folder names
/// Action that creates a new untitled folder
@objc
func newFolder() {
guard let item else { return }
workspace?.workspaceFileManager?.addFol... | @@ -0,0 +1,184 @@
+//
+// ProjectNavigatorMenuActions.swift
+// CodeEdit
+//
+// Created by Leonardo Larrañaga on 10/11/24.
+//
+
+import AppKit
+
+extension ProjectNavigatorMenu {
+ /// - Returns: the currently selected `CEWorkspaceFile` items in the outline view.
+ func selectedItems() -> Set<CEWorkspaceFile... | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift | 26 | Swift | 0.714 | suggestion | 128 | 51 | 51 | false | Select multiple files in the project navigator | 1,906 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift
PR Title: Select multiple files in the project navigator
BEFORE CODE: }
reloadData()
sender.outlineView.expandItem(item.isFolder ? item : item... | ```suggestion
var newFolderURL = parent.url.appendingPathComponent("New Folder With Items", conformingTo: .folder)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// TODO: allow custom folder names
/// Action that creates a new untitled folder
@objc
func newFolder() {
guard let item else { return }
workspace?.workspaceFileManager?.addFolder(folderName: "untitled", toFile: item)
reloadData()
sender.outlineView.expandItem(item)
... | ```suggestion
newFolderURL = parent.url.appendingPathComponent("New Folder With Items \(folderNumber)")
``` |
// TODO: allow custom folder names
/// Action that creates a new untitled folder
@objc
func newFolder() {
guard let item else { return }
workspace?.workspaceFileManager?.addFolder(folderName: "untitled", toFile: item)
reloadData()
sender.outlineView.expandItem(item)
... | @@ -0,0 +1,184 @@
+//
+// ProjectNavigatorMenuActions.swift
+// CodeEdit
+//
+// Created by Leonardo Larrañaga on 10/11/24.
+//
+
+import AppKit
+
+extension ProjectNavigatorMenu {
+ /// - Returns: the currently selected `CEWorkspaceFile` items in the outline view.
+ func selectedItems() -> Set<CEWorkspaceFile... | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift | 26 | Swift | 0.714 | suggestion | 121 | 51 | 51 | false | Select multiple files in the project navigator | 1,906 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift
PR Title: Select multiple files in the project navigator
BEFORE CODE:
// TODO: allow custom folder names
/// Action that creates a new untitled folder
@o... | ```suggestion
newFolderURL = parent.url.appendingPathComponent("New Folder With Items \(folderNumber)")
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} catch {
fatalError(error.localizedDescription)
}
}
}
}
/// This function deletes multiple files or folders from the current project by erasing immediately.
/// - Parameters:
/// - files: The files to delete
/// - confirmD... | This will close the application. Just print out the error for now until we have better logging. | } catch {
fatalError(error.localizedDescription)
}
}
}
}
/// This function deletes multiple files or folders from the current project by erasing immediately.
/// - Parameters:
/// - files: The files to delete
/// - confirmD... | @@ -141,6 +141,30 @@ extension CEWorkspaceFileManager {
}
}
+ /// This function deletes multiple files or folders from the current project by erasing immediately.
+ /// - Parameters:
+ /// - files: The files to delete
+ /// - confirmDelete: True to present an alert to confirm the delete.... | CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift | 26 | Swift | 0.429 | suggestion | 96 | 51 | 51 | false | Select multiple files in the project navigator | 1,906 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFileManager+FileManagement.swift
PR Title: Select multiple files in the project navigator
BEFORE CODE: } catch {
fatalError(error.localizedDescription)
}
... | This will close the application. Just print out the error for now until we have better logging. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// Is entire tab being pressed.
@State private var isPressing: Bool = false
/// Is close button being pressed.
@State private var isPressingClose: Bool = false
/// A bool state for going-in animation.
///
/// By default, this value is `false`. When the root view is appeared, it turns `tru... | Might be an idea to rename this to something more descriptive? | /// Is entire tab being pressed.
@State private var isPressing: Bool = false
/// Is close button being pressed.
@State private var isPressingClose: Bool = false
/// A bool state for going-in animation.
///
/// By default, this value is `false`. When the root view is appeared, it turns `tru... | @@ -57,7 +60,7 @@ struct EditorTabView: View {
/// The item associated with the current tab.
///
/// You can get tab-related information from here, like `label`, `icon`, etc.
- private var item: CEWorkspaceFile
+ private let item: CEWorkspaceFile | CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabView.swift | 26 | Swift | 0.286 | question | 62 | 51 | 51 | false | Add indication for externally deleted files | 1,999 | CodeEditApp/CodeEdit | 18,361 | Swift | matthijseikelenboom | pro100filipp | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabView.swift
PR Title: Add indication for externally deleted files
BEFORE CODE: /// Is entire tab being pressed.
@State private var isPressing: Bool = false
/// Is close button being pressed.
@Sta... | Might be an idea to rename this to something more descriptive? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// EditorTabFileObserver.swift
// CodeEdit
//
// Created by Filipp Kuznetsov on 25.02.2025.
//
import Foundation
import SwiftUI
/// Observer ViewModel for tracking file deletion
final class EditorTabFileObserver: ObservableObject, CEWorkspaceFileManagerObserver {
@Published private(set) var isDeleted = fals... | I believe this can be simplified, and I’m fairly certain it should be updated on the main thread as well
```suggestion
func fileManagerUpdated(updatedItems: Set<CEWorkspaceFile>) {
if let parent = item.parent, updatedItems.contains(parent) {
isDeleted = item.doesExist == false
}
... | //
// EditorTabFileObserver.swift
// CodeEdit
//
// Created by Filipp Kuznetsov on 25.02.2025.
//
import Foundation
import SwiftUI
/// Observer ViewModel for tracking file deletion
@MainActor
final class EditorTabFileObserver: ObservableObject,
CEWorkspaceFileManagerObserver {
@Published private(set) var i... | @@ -0,0 +1,30 @@
+//
+// EditorTabFileObserver.swift
+// CodeEdit
+//
+// Created by Filipp Kuznetsov on 25.02.2025.
+//
+
+import Foundation
+import SwiftUI
+
+/// Observer ViewModel for tracking file deletion
+final class EditorTabFileObserver: ObservableObject, CEWorkspaceFileManagerObserver {
+ @Published pri... | CodeEdit/Features/Editor/TabBar/Tabs/Tab/Models/EditorTabFileObserver.swift | 26 | Swift | 1 | suggestion | 326 | 31 | 31 | false | Add indication for externally deleted files | 1,999 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | pro100filipp | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/TabBar/Tabs/Tab/Models/EditorTabFileObserver.swift
PR Title: Add indication for externally deleted files
BEFORE CODE: //
// EditorTabFileObserver.swift
// CodeEdit
//
// Created by Filipp Kuznetsov on 25.02.2025.
//
import Foundatio... | I believe this can be simplified, and I’m fairly certain it should be updated on the main thread as well
```suggestion
func fileManagerUpdated(updatedItems: Set<CEWorkspaceFile>) {
if let parent = item.parent, updatedItems.contains(parent) {
isDeleted = item.doesExist == false
}
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/// Copies the absolute path of the given `FileItem`
/// - Parameter item: The `FileItem` to use.
private func copyPath(item: CEWorkspaceFile) {
NSPasteboard.general.clearContents()
NSPasteboard.general.setString(item.url.standardizedFileURL.path, forType: .string)
}
func moveToNewS... | I updated the previous implementation for relative path to avoid array shifting | /// Copies the absolute path of the given `FileItem`
/// - Parameter item: The `FileItem` to use.
private func copyPath(item: CEWorkspaceFile) {
NSPasteboard.general.clearContents()
NSPasteboard.general.setString(item.url.standardizedFileURL.path, forType: .string)
}
func moveToNewS... | @@ -149,24 +149,21 @@ struct EditorTabBarContextMenu: ViewModifier {
guard let rootPath = workspace.workspaceFileManager?.folderUrl else {
return
}
- // Calculate the relative path
- var rootComponents = rootPath.standardizedFileURL.pathComponents
- var destinationCom... | CodeEdit/Features/Editor/TabBar/Views/EditorTabBarContextMenu.swift | 26 | Swift | 0.286 | suggestion | 79 | 42 | 39 | false | Added copy path and copy relative path options in project navigator menu | 2,013 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | FastestMolasses | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/TabBar/Views/EditorTabBarContextMenu.swift
PR Title: Added copy path and copy relative path options in project navigator menu
BEFORE CODE: /// Copies the absolute path of the given `FileItem`
/// - Parameter item: The `FileItem`... | I updated the previous implementation for relative path to avoid array shifting | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
guard let workspace else { return }
/// If the filter is empty, show all items and restore the expanded state.
if workspace.sourceControlFilter || !filterIsEmpty {
outlineView.autosaveExpandedItems = false
/// Expand all items for search.
outlineView.expandI... | The double negation is hard to read. Can you simplify it to: `sourceControlFilter || !filterIsEmpty` |
guard let workspace else { return }
/// If the filter is empty, show all items and restore the expanded state.
if workspace.sourceControlFilter || !filterIsEmpty {
outlineView.autosaveExpandedItems = false
/// Expand all items for search.
outlineView.expandI... | @@ -213,16 +217,24 @@ final class ProjectNavigatorViewController: NSViewController {
}
/// Checks if the given filter matches the name of the item or any of its children.
- func fileSearchMatches(_ filter: String, for item: CEWorkspaceFile) -> Bool {
- guard !filter.trimmingCharacters(in: .whitesp... | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift | 26 | Swift | 0.571 | refactor | 100 | 51 | 51 | false | Source Control Filter | 2,024 | CodeEditApp/CodeEdit | 18,361 | Swift | FastestMolasses | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift
PR Title: Source Control Filter
BEFORE CODE:
guard let workspace else { return }
/// If the filter is empty, show all items and restore the expan... | The double negation is hard to read. Can you simplify it to: `sourceControlFilter || !filterIsEmpty` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if newValue != iconColor {
outlineView?.reloadData()
}
}
}
var fileExtensionsVisibility: SettingsData.FileExtensionsVisibility = .showAll
var shownFileExtensions: SettingsData.FileExtensions = .default
var hiddenFileExtensions: SettingsData.FileExtensions... | ```suggestion
workspace?.navigatorFilter.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == true
``` | if newValue != iconColor {
outlineView?.reloadData()
}
}
}
var fileExtensionsVisibility: SettingsData.FileExtensionsVisibility = .showAll
var shownFileExtensions: SettingsData.FileExtensions = .default
var hiddenFileExtensions: SettingsData.FileExtensions... | @@ -64,6 +64,10 @@ final class ProjectNavigatorViewController: NSViewController {
/// to open the file a second time.
var shouldSendSelectionUpdate: Bool = true
+ var filterIsEmpty: Bool {
+ workspace?.navigatorFilter.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty | CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift | 26 | Swift | 0.714 | suggestion | 118 | 51 | 51 | false | Source Control Filter | 2,024 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift
PR Title: Source Control Filter
BEFORE CODE: if newValue != iconColor {
outlineView?.reloadData()
}
}
}
va... | ```suggestion
workspace?.navigatorFilter.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == true
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// Created by TAY KAI QUAN on 23/7/22.
//
import SwiftUI
struct ProjectNavigatorToolbarBottom: View {
@Environment(\.controlActiveState)
private var activeState
@Environment(\.colorScheme)
private var colorScheme
@EnvironmentObject var workspace: WorkspaceDocument
@EnvironmentObject var ... | I tried modifying the `FilterDropDownIconButton` to have a Picker, but couldn't figure out how to remove the selected value label from it. | //
// Created by TAY KAI QUAN on 23/7/22.
//
import SwiftUI
struct ProjectNavigatorToolbarBottom: View {
@Environment(\.controlActiveState)
private var activeState
@Environment(\.colorScheme)
private var colorScheme
@EnvironmentObject var workspace: WorkspaceDocument
@EnvironmentObject var ... | @@ -27,10 +27,20 @@ struct ProjectNavigatorToolbarBottom: View {
text: $workspace.navigatorFilter,
leadingAccessories: {
FilterDropDownIconButton(menu: { | CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift | 26 | Swift | 0.571 | suggestion | 138 | 51 | 51 | false | Sort alphabetically - Folders on top | 2,028 | CodeEditApp/CodeEdit | 18,361 | Swift | LeonardoLarranaga | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift
PR Title: Sort alphabetically - Folders on top
BEFORE CODE: //
// Created by TAY KAI QUAN on 23/7/22.
//
import SwiftUI
struct ProjectNavigatorToolbarBottom: View {
@Env... | I tried modifying the `FilterDropDownIconButton` to have a Picker, but couldn't figure out how to remove the selected value label from it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@State var recentsFilter: Bool = false
var body: some View {
HStack(spacing: 5) {
addNewFileButton
PaneTextField(
"Filter",
text: $workspace.navigatorFilter,
leadingAccessories: {
FilterDropDownIconButton(menu: ... | A little uglier in code but this would work to get the better checkmark in that menu
```suggestion
FilterDropDownIconButton(
menu: {
Toggle(
"Folder on top",
isOn: Binding(
... | @State var recentsFilter: Bool = false
var body: some View {
HStack(spacing: 5) {
addNewFileButton
PaneTextField(
"Filter",
text: $workspace.navigatorFilter,
leadingAccessories: {
FilterDropDownIconButton(menu: ... | @@ -27,10 +27,20 @@ struct ProjectNavigatorToolbarBottom: View {
text: $workspace.navigatorFilter,
leadingAccessories: {
FilterDropDownIconButton(menu: {
- Button {
- workspace.sortFoldersOnTop.toggle()
- ... | CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift | 26 | Swift | 0.857 | suggestion | 1,581 | 51 | 51 | false | Sort alphabetically - Folders on top | 2,028 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | LeonardoLarranaga | Review this pull request change.
Language: Swift
File: CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorToolbarBottom.swift
PR Title: Sort alphabetically - Folders on top
BEFORE CODE: @State var recentsFilter: Bool = false
var body: some View {
HStack(spacing: 5) {
addNe... | A little uglier in code but this would work to get the better checkmark in that menu
```suggestion
FilterDropDownIconButton(
menu: {
Toggle(
"Folder on top",
isOn: Binding(
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// RecentProjectsUtil.swift
// CodeEdit
//
// Created by Khan Winter on 10/22/24.
//
import AppKit
import CoreSpotlight
/// Helper methods for managing the recent projects list and donating list items to CoreSpotlight.
///
/// Limits the number of remembered projects to 100 items.
///
/// If a UI element needs ... | ```suggestion
static let shared = RecentProjectsStore()
```
In Swift, singleton objects are typically named using conventions like `shared` or `standard`. | //
// RecentProjectsUtil.swift
// CodeEdit
//
// Created by Khan Winter on 10/22/24.
//
import AppKit
import CoreSpotlight
import OSLog
/// Helper methods for managing the recent projects list and donating list items to CoreSpotlight.
///
/// Limits the number of remembered projects to 100 items.
///
/// If a UI e... | @@ -14,20 +14,50 @@ import CoreSpotlight
///
/// If a UI element needs to listen to changes in this list, listen for the
/// ``RecentProjectsStore/didUpdateNotification`` notification.
-enum RecentProjectsStore {
- private static let defaultsKey = "recentProjectPaths"
+class RecentProjectsStore {
+ /// The def... | CodeEdit/Features/Welcome/Model/RecentProjectsStore.swift | 19 | Swift | 0.714 | suggestion | 161 | 44 | 44 | false | Separated files and folders in the "Open Recent" sub-menu | 2,039 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | atsrus | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Welcome/Model/RecentProjectsStore.swift
PR Title: Separated files and folders in the "Open Recent" sub-menu
BEFORE CODE: //
// RecentProjectsUtil.swift
// CodeEdit
//
// Created by Khan Winter on 10/22/24.
//
import AppKit
import CoreSpotl... | ```suggestion
static let shared = RecentProjectsStore()
```
In Swift, singleton objects are typically named using conventions like `shared` or `standard`. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
init() {
let defaults = UserDefaults(suiteName: #file)!
store = RecentProjectsStore(defaults: defaults)
}
deinit {
try? FileManager.default.removeItem(atPath: #file + ".plist")
}
@Test
func newStoreEmpty() {
#expect(store.recentURLs().isEmpty)
}
@Test
... | ```suggestion
for idx in 0..<101 {
```
| class RecentProjectsTests {
let store: RecentProjectsStore
init() {
let defaults = UserDefaults(suiteName: #file)!
defaults.removeSuite(named: #file)
store = RecentProjectsStore(defaults: defaults)
}
deinit {
try? FileManager.default.removeItem(atPath: #file + ".plist")... | @@ -0,0 +1,50 @@
+//
+// RecentProjectsTests.swift
+// CodeEditTests
+//
+// Created by Khan Winter on 5/27/25.
+//
+
+import Testing
+import Foundation
+@testable import CodeEdit
+
+class RecentProjectsTests {
+ let store: RecentProjectsStore
+
+ init() {
+ let defaults = UserDefaults(suiteName: #file)... | CodeEditTests/Features/Welcome/RecentProjectsTests.swift | 26 | Swift | 0.429 | suggestion | 50 | 38 | 51 | false | Separated files and folders in the "Open Recent" sub-menu | 2,039 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | atsrus | Review this pull request change.
Language: Swift
File: CodeEditTests/Features/Welcome/RecentProjectsTests.swift
PR Title: Separated files and folders in the "Open Recent" sub-menu
BEFORE CODE:
init() {
let defaults = UserDefaults(suiteName: #file)!
store = RecentProjectsStore(defaults: defaults... | ```suggestion
for idx in 0..<101 {
```
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import AppKit
import CoreSpotlight
/// Helper methods for managing the recent projects list and donating list items to CoreSpotlight.
///
/// Limits the number of remembered projects to 100 items.
///
/// If a UI element needs to listen to changes in this list, listen for the
/// ``RecentProjectsStore/didUpdateNotifi... | Shouldn't the constructor be private since this class is meant to be used as a singleton?
Is there a reason to use something other than `UserDefaults.standard` in this case? |
import AppKit
import CoreSpotlight
import OSLog
/// Helper methods for managing the recent projects list and donating list items to CoreSpotlight.
///
/// Limits the number of remembered projects to 100 items.
///
/// If a UI element needs to listen to changes in this list, listen for the
/// ``RecentProjectsStore/di... | @@ -14,20 +14,50 @@ import CoreSpotlight
///
/// If a UI element needs to listen to changes in this list, listen for the
/// ``RecentProjectsStore/didUpdateNotification`` notification.
-enum RecentProjectsStore {
- private static let defaultsKey = "recentProjectPaths"
+class RecentProjectsStore {
+ /// The def... | CodeEdit/Features/Welcome/Model/RecentProjectsStore.swift | 26 | Swift | 0.571 | question | 174 | 51 | 51 | false | Separated files and folders in the "Open Recent" sub-menu | 2,039 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | atsrus | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Welcome/Model/RecentProjectsStore.swift
PR Title: Separated files and folders in the "Open Recent" sub-menu
BEFORE CODE:
import AppKit
import CoreSpotlight
/// Helper methods for managing the recent projects list and donating list items to C... | Shouldn't the constructor be private since this class is meant to be used as a singleton?
Is there a reason to use something other than `UserDefaults.standard` in this case? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
display displayDocument: Bool,
completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void
) {
super.openDocument(withContentsOf: url, display: displayDocument) { document, documentWasAlreadyOpen, error in
if let document {
self.addDocument(document)
... | Are all opened documents stored in `documents`, or only those within opened workspaces? If it’s the former, this could lead to performance issues when working with multiple large projects, and then trying to open a file. | display displayDocument: Bool,
completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void
) {
guard !openFileInExistingWorkspace(url: url) else {
return
}
super.openDocument(withContentsOf: url, display: displayDocument) { document, documentWasAlreadyOpen, ... | @@ -73,6 +76,28 @@ final class CodeEditDocumentController: NSDocumentController {
}
}
+ /// Attempt to open the file URL in an open workspace, finding the nearest workspace to open it in if possible.
+ /// - Parameter url: The file URL to open.
+ /// - Returns: True, if the document was opened ... | CodeEdit/Features/Documents/Controllers/CodeEditDocumentController.swift | 26 | Swift | 0.786 | performance | 220 | 51 | 51 | false | Open New Files in Workspace | 2,043 | CodeEditApp/CodeEdit | 18,361 | Swift | tom-ludwig | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditDocumentController.swift
PR Title: Open New Files in Workspace
BEFORE CODE: display displayDocument: Bool,
completionHandler: @escaping (NSDocument?, Bool, Error?) -> Void
) {
super.ope... | Are all opened documents stored in `documents`, or only those within opened workspaces? If it’s the former, this could lead to performance issues when working with multiple large projects, and then trying to open a file. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
@EnvironmentObject private var utilityAreaViewModel: UtilityAreaViewModel
internal var body: some View {
Button {
utilityAreaViewModel.togglePanel()
} label: {
Image(systemName: "square.bottomthird.inset.filled")
}
.buttonStyle(.icon)
.keyboardSho... | I'm not sure this should be a user-facing command, it looks odd in the commands panel with the "Toggle Utility Area" command.

| @EnvironmentObject private var utilityAreaViewModel: UtilityAreaViewModel
internal var body: some View {
Button {
utilityAreaViewModel.togglePanel()
} label: {
Image(systemName: "square.bottomthird.inset.filled")
}
.buttonStyle(.icon)
.keyboardSho... | @@ -31,6 +31,12 @@ internal struct StatusBarToggleUtilityAreaButton: View {
id: "open.drawer",
command: { [weak utilityAreaViewModel] in utilityAreaViewModel?.togglePanel() }
)
+ CommandManager.shared.addCommand(
+ name: "Toggl... | CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift | 26 | Swift | 0.5 | refactor | 251 | 45 | 33 | false | Hide interface | 2,044 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | SimonKudsk | Review this pull request change.
Language: Swift
File: CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarToggleUtilityAreaButton.swift
PR Title: Hide interface
BEFORE CODE: @EnvironmentObject private var utilityAreaViewModel: UtilityAreaViewModel
internal var body: some View {
Button {
... | I'm not sure this should be a user-facing command, it looks odd in the commands panel with the "Toggle Utility Area" command.

| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
var fileItems: [CEWorkspaceFile] {
var treePath: [CEWorkspaceFile] = []
var currentFile: CEWorkspaceFile? = file
while let currentFileLoop = currentFile {
treePath.insert(currentFileLoop, at: 0)
currentFile = currentFileLoop.parent
}
return tr... | ```suggestion
)
.frame(maxHeight: .infinity)
```
This doesn't fill it's available vertical space with the GeometryReader, adding a larger height fixes it. | }
var fileItems: [CEWorkspaceFile] {
var treePath: [CEWorkspaceFile] = []
var currentFile: CEWorkspaceFile? = file
while let currentFileLoop = currentFile {
treePath.insert(currentFileLoop, at: 0)
currentFile = currentFileLoop.parent
}
return tr... | @@ -50,25 +56,60 @@ struct EditorJumpBarView: View {
}
var body: some View {
- ScrollView(.horizontal, showsIndicators: false) {
- HStack(spacing: 0) {
- if file == nil {
- Text("No Selection")
- .font(.system(size: 11, weight: .regu... | CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift | 26 | Swift | 0.786 | suggestion | 216 | 51 | 51 | false | Jump Bar Overflow Accordion Effect | 2,045 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | swiftlysingh | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift
PR Title: Jump Bar Overflow Accordion Effect
BEFORE CODE: }
var fileItems: [CEWorkspaceFile] {
var treePath: [CEWorkspaceFile] = []
var currentFile: CEWorkspaceFile? = file... | ```suggestion
)
.frame(maxHeight: .infinity)
```
This doesn't fill it's available vertical space with the GeometryReader, adding a larger height fixes it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
}
var body: some View {
NSPopUpButtonView(selection: $selection) {
guard let fileManager = workspace.workspaceFileManager else { return NSPopUpButton() }
button.menu = EditorJumpBarMenu(
fileItems: siblings,
fileManager: fileManager,
... | Correct me if I'm wrong but I think the gradient should disable when hovering too.
```suggestion
stops: truncatedCrumbWidth == nil || isHovering ?
``` | }
}
var body: some View {
NSPopUpButtonView(selection: $selection) {
guard let fileManager = workspace.workspaceFileManager else { return NSPopUpButton() }
button.menu = EditorJumpBarMenu(
fileItems: siblings,
fileManager: fileManager,
... | @@ -65,6 +68,28 @@ struct EditorJumpBarComponent: View {
return button
}
+ .frame(
+ maxWidth: isHovering || isLastItem ? nil : truncatedCrumbWidth,
+ alignment: .leading
+ )
+ .mask(
+ LinearGradient(
+ gradient: Gradient(
+ ... | CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarComponent.swift | 26 | Swift | 0.786 | bug | 173 | 51 | 51 | false | Jump Bar Overflow Accordion Effect | 2,045 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | swiftlysingh | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarComponent.swift
PR Title: Jump Bar Overflow Accordion Effect
BEFORE CODE: }
}
var body: some View {
NSPopUpButtonView(selection: $selection) {
guard let fileManager = work... | Correct me if I'm wrong but I think the gradient should disable when hovering too.
```suggestion
stops: truncatedCrumbWidth == nil || isHovering ?
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
}
.frame(height: Self.height, alignment: .center)
.opacity(activeState == .inactive ? 0.8 : 1.0)
.grayscale(isActiveEditor ? 0.0 : 1.0)
}
private func resize() {
let minWidth: CGFloat = 20
let snapThreshold: CGFloat = 30
let maxWidth: CGFloa... | ```suggestion
if betweenWidth > snapThreshold || crumbWidth == nil {
```
I noticed that the first crumb _always_ has the overlay gradient, except when other crumbs are being truncated and the first item hasn't begun truncating yet. This fixes that, but please let me know if I'm misunderstanding the variabl... | EditorTabBarTrailingAccessories(codeFile: $codeFile)
}
}
.frame(height: Self.height, alignment: .center)
.opacity(activeState == .inactive ? 0.8 : 1.0)
.grayscale(isActiveEditor ? 0.0 : 1.0)
}
private func resize() {
let minWidth: CGFloat = 20... | @@ -86,4 +127,40 @@ struct EditorJumpBarView: View {
.opacity(activeState == .inactive ? 0.8 : 1.0)
.grayscale(isActiveEditor ? 0.0 : 1.0)
}
+
+ private func resize() {
+ let minWidth: CGFloat = 20
+ let snapThreshold: CGFloat = 30
+ let maxWidth: CGFloat = textWidth / CGF... | CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift | 26 | Swift | 0.857 | suggestion | 531 | 44 | 45 | false | Jump Bar Overflow Accordion Effect | 2,045 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | swiftlysingh | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/JumpBar/Views/EditorJumpBarView.swift
PR Title: Jump Bar Overflow Accordion Effect
BEFORE CODE: }
}
.frame(height: Self.height, alignment: .center)
.opacity(activeState == .inactive ? 0.8 : 1.0)
... | ```suggestion
if betweenWidth > snapThreshold || crumbWidth == nil {
```
I noticed that the first crumb _always_ has the overlay gradient, except when other crumbs are being truncated and the first item hasn't begun truncating yet. This fixes that, but please let me know if I'm misunderstanding the variabl... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
let pipe = Pipe()
process.standardOutput = pipe
do {
try process.run()
process.waitUntilExit()
return process.terminationStatus == 0
} catch {
return false
}
}
/// Check if clipboard contains git url
func checkClipboard... | ```suggestion
alertMsg: "Git installation not found.",
infoText: "Ensure Git is installed on your system and try again."
``` | let pipe = Pipe()
process.standardOutput = pipe
do {
try process.run()
process.waitUntilExit()
return process.terminationStatus == 0
} catch {
return false
}
}
/// Check if clipboard contains git url
func checkClipboard... | @@ -43,6 +59,13 @@ class GitCloneViewModel: ObservableObject {
/// Clone repository
func cloneRepository(completionHandler: @escaping (URL) -> Void) {
+ if !isGitInstalled() {
+ showAlert(
+ alertMsg: "Git installation not found",
+ infoText: "Ensure Git is in... | CodeEdit/Features/SourceControl/Clone/ViewModels/GitCloneViewModel.swift | 26 | Swift | 0.714 | suggestion | 159 | 51 | 51 | false | Added check for git installation presence | 2,047 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | rustemd02 | Review this pull request change.
Language: Swift
File: CodeEdit/Features/SourceControl/Clone/ViewModels/GitCloneViewModel.swift
PR Title: Added check for git installation presence
BEFORE CODE: let pipe = Pipe()
process.standardOutput = pipe
do {
try process.run()
proc... | ```suggestion
alertMsg: "Git installation not found.",
infoText: "Ensure Git is installed on your system and try again."
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
EditorTabDivider()
.opacity((isActive || inHoldingState) ? 0.0 : 1.0)
}
.foregroundColor(
isActive && isActiveEditor
? (
colorScheme != .dark
? Color(nsColor: .controlAccentColor)
: .primary
)... | One small thing with this is that this local monitor does not get cleaned up automatically. Can we add a `@State` reference to it and clean it up with the `onDisappear`? | : isActive ? 0.6 : 0.4
)
EditorTabDivider()
.opacity((isActive || inHoldingState) ? 0.0 : 1.0)
}
.foregroundColor(
isActive && isActiveEditor
? (
colorScheme != .dark
? Color(nsColor: .control... | @@ -193,6 +193,16 @@ struct EditorTabView: View {
}
}
}
+ .onAppear {
+ NSEvent.addLocalMonitorForEvents(matching: .otherMouseDown) { event in | CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabView.swift | 26 | Swift | 0.5 | question | 169 | 51 | 51 | false | Added closing tabs with middle click | 2,127 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | myaumura | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabView.swift
PR Title: Added closing tabs with middle click
BEFORE CODE: EditorTabDivider()
.opacity((isActive || inHoldingState) ? 0.0 : 1.0)
}
.foregroundColor(
... | One small thing with this is that this local monitor does not get cleaned up automatically. Can we add a `@State` reference to it and clean it up with the `onDisappear`? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
//
// SideBar.swift
// CodeEdit
//
// Created by Lukas Pistrol on 17.03.22.
//
import SwiftUI
import WorkspaceClient
struct NavigatorSidebar: View {
@ObservedObject var workspace: WorkspaceDocument
var windowController: NSWindowController
@State private var selection: Int = 0
var body: some View {
... | No issues found. | //
// SideBar.swift
// CodeEdit
//
// Created by Lukas Pistrol on 17.03.22.
//
import SwiftUI
import WorkspaceClient
struct NavigatorSidebar: View {
@ObservedObject var workspace: WorkspaceDocument
var windowController: NSWindowController
@State private var selection: Int = 0
var body: some View {
... | @@ -8,7 +8,7 @@
import SwiftUI
import WorkspaceClient
-struct SideBar: View {
+struct NavigatorSidebar: View {
@ObservedObject var workspace: WorkspaceDocument
var windowController: NSWindowController
@State private var selection: Int = 0
@@ -21,7 +21,7 @@ struct SideBar: View {
For... | CodeEdit/NavigatorSidebar/NavigatorSidebar.swift | 0 | Swift | 1 | none | 16 | 43 | 43 | true | Placeholder Inspector Sidebar | 141 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | Review this pull request change.
Language: Swift
File: CodeEdit/NavigatorSidebar/NavigatorSidebar.swift
PR Title: Placeholder Inspector Sidebar
BEFORE CODE: //
// SideBar.swift
// CodeEdit
//
// Created by Lukas Pistrol on 17.03.22.
//
import SwiftUI
import WorkspaceClient
struct NavigatorSidebar: View {
@... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
pasteboard.clearContents()
pasteboard.setString(copyString, forType: .string)
}
public var body: some View {
ZStack(alignment: .topLeading) {
VStack(spacing: 8) {
Spacer().frame(height: 12)
Image(nsImage: NSApp.applicationIconImage)
... | No issues found. | pasteboard.clearContents()
pasteboard.setString(copyString, forType: .string)
}
public var body: some View {
ZStack(alignment: .topLeading) {
VStack(spacing: 8) {
Spacer().frame(height: 12)
Image(nsImage: NSApp.applicationIconImage)
... | @@ -9,9 +9,11 @@ import SwiftUI
import AppKit
import Foundation
import AppPreferences
+import GitClone
public struct WelcomeView: View {
@Environment(\.colorScheme) var colorScheme
+ @State var showGitClone = false
@State var isHovering: Bool = false
@State var isHoveringClose: Bool = false
... | CodeEditModules/Modules/WelcomeModule/src/WelcomeView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add functionality for cloning from git in welcome view | 232 | CodeEditApp/CodeEdit | 18,361 | Swift | Pythonen | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/WelcomeModule/src/WelcomeView.swift
PR Title: Add functionality for cloning from git in welcome view
BEFORE CODE: pasteboard.clearContents()
pasteboard.setString(copyString, forType: .string)
}
public var body: s... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
case large
}
}
public extension AppPreferences {
/// A dictionary containing the keys and associated ``Theme/Attributes`` of overridden properties
///
/// ```json
/// {
/// "editor" : {
/// "background" : {
/// "color" : "#123456"
/// },
/// ...
... | No issues found. | case large
}
}
public extension AppPreferences {
/// A dictionary containing the keys and associated ``Theme/Attributes`` of overridden properties
///
/// ```json
/// {
/// "editor" : {
/// "background" : {
/// "color" : "#123456"
/// },
/// ...
... | @@ -61,6 +61,9 @@ public extension AppPreferences {
/// The reopen behavior of the app
public var reopenBehavior: ReopenBehavior = .welcome
+ /// The size of the project navigators rows.
+ public var projectNavigatorSize: ProjectNavigatorSize = .medium
+
/// Default initialize... | CodeEditModules/Modules/AppPreferences/src/Model/AppPreferences.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | `Project Navigator`: Implemented Setting for changing Item Size | 418 | CodeEditApp/CodeEdit | 18,361 | Swift | lukepistrol | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Model/AppPreferences.swift
PR Title: `Project Navigator`: Implemented Setting for changing Item Size
BEFORE CODE: case large
}
}
public extension AppPreferences {
/// A dictionary containing the keys... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
PreferencesSection("Author Name", hideLabels: false) {
TextField("Git Author Name", text: $prefs.preferences.sourceControl.git.authorName)
.frame(width: inputWidth)
}
PreferencesSection("Author Email", hideLabels: false) {
TextFiel... | No issues found. | PreferencesSection("Author Name", hideLabels: false) {
TextField("Git Author Name", text: $prefs.preferences.sourceControl.git.authorName)
.frame(width: inputWidth)
}
PreferencesSection("Author Email", hideLabels: false) {
TextFiel... | @@ -10,6 +10,8 @@ import CodeEditUI
struct SourceControlGitView: View {
+ private let inputWidth: Double = 280
+
@State var ignoredFileSelection: IgnoredFiles.ID?
@StateObject
@@ -19,12 +21,12 @@ struct SourceControlGitView: View {
VStack {
PreferencesSection("Author Name", hid... | CodeEditModules/Modules/AppPreferences/src/Sections/SourceControlPreferences/SourceControlGitView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Preferences: Add Comparison View and Source Control Navigator | 453 | CodeEditApp/CodeEdit | 18,361 | Swift | Angelk90 | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Sections/SourceControlPreferences/SourceControlGitView.swift
PR Title: Preferences: Add Comparison View and Source Control Navigator
BEFORE CODE: PreferencesSection("Author Name", hideLabels: false) {
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
internal let shellClient: ShellClient
@Binding internal var isPresented: Bool
@Binding internal var repoPath: String
// TODO: This has to be derived from git
@State internal var selectedBranch = "main"
public init(isPresented: Binding<Bool>,
repoPath: Binding<String>,
... | No issues found. | internal let shellClient: ShellClient
@Binding internal var isPresented: Bool
@Binding internal var repoPath: String
// TODO: This has to be derived from git
@State internal var selectedBranch = "main"
public init(isPresented: Binding<Bool>,
repoPath: Binding<String>,
... | @@ -0,0 +1,76 @@
+//
+// CheckoutBranchView.swift
+//
+//
+// Created by Aleksi Puttonen on 14.4.2022.
+//
+
+import Foundation
+import SwiftUI
+import GitClient
+import ShellClient
+
+public struct CheckoutBranchView: View {
+ internal let shellClient: ShellClient
+ @Binding internal var isPresented: Bool
+ ... | CodeEditModules/Modules/GitClone/src/CheckoutBranchView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Branch checkout after cloning | 460 | CodeEditApp/CodeEdit | 18,361 | Swift | Pythonen | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/GitClone/src/CheckoutBranchView.swift
PR Title: Branch checkout after cloning
BEFORE CODE: internal let shellClient: ShellClient
@Binding internal var isPresented: Bool
@Binding internal var repoPath: String
// TODO: This... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
),
],
targets: [
.target(
name: "WorkspaceClient",
path: "Modules/WorkspaceClient/src"
),
.testTarget(
name: "WorkspaceClientTests",
dependencies: [
"WorkspaceClient",
],
path: "Modules/Worksp... | No issues found. | ),
],
targets: [
.target(
name: "WorkspaceClient",
path: "Modules/WorkspaceClient/src"
),
.testTarget(
name: "WorkspaceClientTests",
dependencies: [
"WorkspaceClient",
],
path: "Modules/Worksp... | @@ -228,6 +228,7 @@ let package = Package(
"CodeEditUI",
"GitAccounts",
"CodeEditUtils",
+ "CodeEditSymbols",
],
path: "Modules/AppPreferences/src"
), | CodeEditModules/Package.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Line Gutter & Accounts: Put the correct font and width size, also added vault icons | 469 | CodeEditApp/CodeEdit | 18,361 | Swift | nanashili | Review this pull request change.
Language: Swift
File: CodeEditModules/Package.swift
PR Title: Line Gutter & Accounts: Put the correct font and width size, also added vault icons
BEFORE CODE: ),
],
targets: [
.target(
name: "WorkspaceClient",
path: "Modules/WorkspaceC... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
@StateObject
private var prefs: AppPreferencesModel = .shared
var body: some View {
HStack(alignment: .center, spacing: 0) {
// Tab bar navigation control.
// TODO: Real functionality of tab bar navigation control and their stated foreground color.
HStack(spacing... | No issues found. | @StateObject
private var prefs: AppPreferencesModel = .shared
var body: some View {
HStack(alignment: .center, spacing: 0) {
// Tab bar navigation control.
// TODO: Real functionality of tab bar navigation control and their stated foreground color.
HStack(spacing... | @@ -87,6 +87,8 @@ struct TabBar: View {
NSVisualEffectView.Material.titlebar,
blendingMode: NSVisualEffectView.BlendingMode.withinWindow
)
+ .background(Color(nsColor: .controlBackgroundColor))
+ .edgesIgnoringSafeArea(.top)
... | CodeEdit/TabBar/TabBar.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Fix Tab Color Issue in Native Style | 483 | CodeEditApp/CodeEdit | 18,361 | Swift | lilingxi01 | Review this pull request change.
Language: Swift
File: CodeEdit/TabBar/TabBar.swift
PR Title: Fix Tab Color Issue in Native Style
BEFORE CODE: @StateObject
private var prefs: AppPreferencesModel = .shared
var body: some View {
HStack(alignment: .center, spacing: 0) {
// Tab bar navi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
? Color(nsColor: colorScheme == .dark ? .white : .black)
.opacity(0.12)
: Color(nsColor: colorScheme == .dark ? .white : .black)
.opacity(colorScheme == .dark ? 0.08 : 0.12)
)
}
}
/// The top border for tab bar (between tab bar and... | No issues found. | ? Color(nsColor: colorScheme == .dark ? .white : .black)
.opacity(0.12)
: Color(nsColor: colorScheme == .dark ? .white : .black)
.opacity(colorScheme == .dark ? 0.08 : 0.12)
)
}
}
/// The top border for tab bar (between tab bar and... | @@ -0,0 +1,104 @@
+//
+// TabBarDivider.swift
+// CodeEdit
+//
+// Created by Lingxi Li on 4/22/22.
+//
+
+import SwiftUI
+import AppPreferences
+import CodeEditUI
+
+/// The vertical divider between tab bar items.
+struct TabDivider: View {
+ @Environment(\.colorScheme)
+ var colorScheme
+
+ @StateObject
+... | CodeEdit/TabBar/TabBarDivider.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Fix Inactive Color Issues and Spacing Issues at Tabs and Breadcrumbs | 528 | CodeEditApp/CodeEdit | 18,361 | Swift | lilingxi01 | Review this pull request change.
Language: Swift
File: CodeEdit/TabBar/TabBarDivider.swift
PR Title: Fix Inactive Color Issues and Spacing Issues at Tabs and Breadcrumbs
BEFORE CODE: ? Color(nsColor: colorScheme == .dark ? .white : .black)
.opacity(0.12)
: Color(n... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
self.init(hex: Int(int))
}
/// Initializes a `Color` from an Int (e.g.: 0x112233)
init(hex: Int) {
let red = (hex >> 16) & 0xFF
let green = (hex >> 8) & 0xFF
let blue = hex & 0xFF
self.init(.sRGB, red: Double(red) / 255, green: Double(green) / 255, blue: Double(blue)... | No issues found. | self.init(hex: Int(int))
}
/// Initializes a `Color` from an Int (e.g.: 0x112233)
init(hex: Int) {
let red = (hex >> 16) & 0xFF
let green = (hex >> 8) & 0xFF
let blue = hex & 0xFF
self.init(.sRGB, red: Double(red) / 255, green: Double(green) / 255, blue: Double(blue)... | @@ -0,0 +1,82 @@
+//
+// Color+HEX.swift
+//
+//
+// Created by Lukas Pistrol on 23.03.22.
+//
+
+import SwiftUI
+
+public extension Color {
+
+ /// Initializes a `Color` from a HEX String (e.g.: #112233)
+ init(hex: String) {
+ let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
... | CodeEditModules/Modules/CodeEditUtils/src/Extensions/Color+HEX.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Editor: Apply Theme Colors | 539 | CodeEditApp/CodeEdit | 18,361 | Swift | lukepistrol | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/CodeEditUtils/src/Extensions/Color+HEX.swift
PR Title: Editor: Apply Theme Colors
BEFORE CODE: self.init(hex: Int(int))
}
/// Initializes a `Color` from an Int (e.g.: 0x112233)
init(hex: Int) {
let red = (hex... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
private let color: Color
public var body: some View {
HStack(spacing: 8) {
ForEach(options.indices, id: \.self) { index in
SegmentedControlItem(
label: options[index],
active: preselectedIndex == index,
action: {
... | No issues found. |
private let color: Color
public var body: some View {
HStack(spacing: 8) {
ForEach(options.indices, id: \.self) { index in
SegmentedControlItem(
label: options[index],
active: preselectedIndex == index,
action: {
... | @@ -9,10 +9,6 @@ import SwiftUI
/// A view that creates a segmented control from an array of text labels.
public struct SegmentedControl: View {
-
- @Environment(\.colorScheme)
- private var colorScheme
-
/// A view that creates a segmented control from an array of text labels.
/// - Parameters:
... | CodeEditModules/Modules/CodeEditUI/src/SegmentedControl.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Added hover, push, and inactive states for mini tabs. | 551 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/CodeEditUI/src/SegmentedControl.swift
PR Title: Added hover, push, and inactive states for mini tabs.
BEFORE CODE:
private let color: Color
public var body: some View {
HStack(spacing: 8) {
ForEach(options.i... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// TODO: Implement reflecting Show Live Issues preference and remove disabled modifier
var showLiveIssuesSection: some View {
PreferencesSection("", hideLabels: false, align: .center) {
Toggle(isOn: $prefs.preferences.general.showLiveIssues) {
Text("Show Live Issues")
... | No issues found. | // TODO: Implement reflecting Show Live Issues preference and remove disabled modifier
var showLiveIssuesSection: some View {
PreferencesSection("", hideLabels: false, align: .center) {
Toggle(isOn: $prefs.preferences.general.showLiveIssues) {
Text("Show Live Issues")
... | @@ -19,62 +19,173 @@ public struct GeneralPreferencesView: View {
public var body: some View {
PreferencesContent {
- PreferencesSection("Appearance") {
- Picker("Appearance:", selection: $prefs.preferences.general.appAppearance) {
- Text("System")
- ... | CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | [WIP] Add missing general preferences | 560 | CodeEditApp/CodeEdit | 18,361 | Swift | drucelweisse | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift
PR Title: [WIP] Add missing general preferences
BEFORE CODE: // TODO: Implement reflecting Show Live Issues preference and remove disabled modifier
var s... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
.frame(width: inputWidth)
Toggle("Show Live Issues", isOn: $prefs.preferences.general.showLiveIssues)
.toggleStyle(.checkbox)
}
.disabled(true)
}
// TODO: Implement reflecting File Extensions preference and remove disabled modifier
var fileExtensions... | No issues found. | .frame(width: inputWidth)
Toggle("Show Live Issues", isOn: $prefs.preferences.general.showLiveIssues)
.toggleStyle(.checkbox)
}
.disabled(true)
}
// TODO: Implement reflecting File Extensions preference and remove disabled modifier
var fileExtensions... | @@ -142,7 +142,6 @@ private extension GeneralPreferencesView {
}
}
- // TODO: Implement reflecting Find Navigator Detail preference and remove disabled modifier
var findNavigatorDetailSection: some View {
PreferencesSection("Find Navigator Detail") {
Picker("Find Navigator ... | CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add Find Navigator Result reflect general preference "Find Navigator Detail" | 581 | CodeEditApp/CodeEdit | 18,361 | Swift | drucelweisse | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift
PR Title: Add Find Navigator Result reflect general preference "Find Navigator Detail"
BEFORE CODE: .frame(width: inputWidth)
Toggle("Sh... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if let mountedVolumes = FileManager.default.mountedVolumeURLs(
includingResourceValuesForKeys: nil,
options: [.skipHiddenVolumes]) {
finderSync.directoryURLs = Set<URL>(mountedVolumes)
}
// Monitor volumes
let notificationCenter = NSWorkspace.shared.no... | No issues found. | if let mountedVolumes = FileManager.default.mountedVolumeURLs(
includingResourceValuesForKeys: nil,
options: [.skipHiddenVolumes]) {
finderSync.directoryURLs = Set<URL>(mountedVolumes)
}
// Monitor volumes
let notificationCenter = NSWorkspace.shared.no... | @@ -0,0 +1,91 @@
+//
+// FinderSync.swift
+// openInCodeEdit
+//
+// Created by Wesley de Groot on 03/05/2022.
+//
+
+/**
+ * For anyone working on this file.
+ * print does not output to the console, use NSLog.
+ * open "console.app" to debug,
+ */
+
+import Cocoa
+import FinderSync
+
+class CEOpenWith: FIFinderSyn... | OpenWithCodeEdit/FinderSync.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Open in CodeEdit | #559 | 597 | CodeEditApp/CodeEdit | 18,361 | Swift | 0xWDG | Review this pull request change.
Language: Swift
File: OpenWithCodeEdit/FinderSync.swift
PR Title: Open in CodeEdit | #559
BEFORE CODE: if let mountedVolumes = FileManager.default.mountedVolumeURLs(
includingResourceValuesForKeys: nil,
options: [.skipHiddenVolumes]) {
fin... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// If it is a `.codeedit` folder this will return `"folder.fill.badge.gearshape"`.
/// If it has children this will return `"folder.fill"` otherwise `"folder"`.
private func folderIcon(_ children: [FileItem]) -> String {
if parent == nil {
return "square.dashed.inset... | No issues found. | /// If it is a `.codeedit` folder this will return `"folder.fill.badge.gearshape"`.
/// If it has children this will return `"folder.fill"` otherwise `"folder"`.
private func folderIcon(_ children: [FileItem]) -> String {
if parent == nil {
return "square.dashed.inset... | @@ -110,6 +110,11 @@ public extension WorkspaceClient {
url.pathExtension
}
+ /// Returns the file name with optional extension (e.g.: `Package.swift`)
+ public func fileName(typeHidden: Bool) -> String {
+ typeHidden ? url.deletingPathExtension().lastPathComponent : fil... | CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add ProjectNavigator OutlineTableViewCell to display file extensions | 598 | CodeEditApp/CodeEdit | 18,361 | Swift | drucelweisse | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift
PR Title: Add ProjectNavigator OutlineTableViewCell to display file extensions
BEFORE CODE: /// If it is a `.codeedit` folder this will return `"folder.fill.badge.gearshape"`.
/// ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
public var body: some View {
VStack(spacing: 0) {
bar
if model.isExpanded {
StatusBarDrawer(model: model)
.transition(.move(edge: .bottom))
}
}
.disabled(controlActive == .inactive)
// removes weird light gray ba... | No issues found. | public var body: some View {
VStack(spacing: 0) {
bar
if model.isExpanded {
StatusBarDrawer(model: model)
.transition(.move(edge: .bottom))
}
}
.disabled(controlActive == .inactive)
// removes weird light gray ba... | @@ -68,11 +68,11 @@ public struct StatusBarView: View {
.padding(.horizontal, 10)
}
.overlay(alignment: .top) {
- Divider()
+ PanelDivider()
}
.overlay(alignment: .bottom) {
if model.isExpanded {
- Divider()
+ ... | CodeEditModules/Modules/StatusBar/src/StatusBar.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Fixed Statusbar Divider Color | 606 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/StatusBar/src/StatusBar.swift
PR Title: Fixed Statusbar Divider Color
BEFORE CODE: public var body: some View {
VStack(spacing: 0) {
bar
if model.isExpanded {
StatusBarDrawer(model: mod... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
public class StatusBarModel: ObservableObject {
// TODO: Implement logic for updating values
// TODO: Add @Published vars for indentation, encoding, linebreak
/// The selected tab in the main section.
/// - **0**: Terminal
/// - **1**: Debugger
/// - **2**: Output
@Published
public var... | No issues found. | public class StatusBarModel: ObservableObject {
// TODO: Implement logic for updating values
// TODO: Add @Published vars for indentation, encoding, linebreak
/// The selected tab in the main section.
/// - **0**: Terminal
/// - **1**: Debugger
/// - **2**: Output
@Published
public var... | @@ -5,57 +5,27 @@
// Created by Lukas Pistrol on 20.03.22.
//
-import Git
import SwiftUI
-import ShellClient
-
-public enum StatusBarTab: String, CaseIterable, Identifiable {
- case terminal
- case debugger
- case output
-
- public var id: String { return self.rawValue }
- public static var allOpti... | CodeEditModules/Modules/StatusBar/src/Model/StatusBarModel.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | StatusBar: Cleanup & Tests | 608 | CodeEditApp/CodeEdit | 18,361 | Swift | lukepistrol | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/StatusBar/src/Model/StatusBarModel.swift
PR Title: StatusBar: Cleanup & Tests
BEFORE CODE: public class StatusBarModel: ObservableObject {
// TODO: Implement logic for updating values
// TODO: Add @Published vars for indentation... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
: .secondary.opacity(0.80)
)
} else {
Image(systemName: "xmark")
.font(.system(size: 9.5, weight: .medium, design: .rounded))
.frame(wid... | No issues found. | : .secondary.opacity(0.80)
)
} else {
Image(systemName: "xmark")
.font(.system(size: 9.5, weight: .medium, design: .rounded))
.frame(wid... | @@ -48,6 +48,8 @@ struct TabBarItem: View {
private var windowController: NSWindowController
+ private var isTemporary: Bool
+
var isActive: Bool {
item.tabID == workspace.selectionState.selectedId
}
@@ -80,6 +82,7 @@ struct TabBarItem: View {
self.item = item
self.windo... | CodeEdit/TabBar/TabBarItem.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add Temporary Tab | 620 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/TabBar/TabBarItem.swift
PR Title: Add Temporary Tab
BEFORE CODE: : .secondary.opacity(0.80)
)
} else {
Image(systemName: "xmark")
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Button("Close Other Tabs") {
withAnimation {
workspace.closeTab(where: { $0 != item.tabID })
}
}
Button("Close Tabs to the Right") {
withAnimation {
workspace.close... | No issues found. | Button("Close Other Tabs") {
withAnimation {
workspace.closeTab(where: { $0 != item.tabID })
}
}
Button("Close Tabs to the Right") {
withAnimation {
workspace.close... | @@ -0,0 +1,140 @@
+//
+// TabBarContextMenu.swift
+// CodeEdit
+//
+// Created by Khan Winter on 6/4/22.
+//
+
+import Foundation
+import SwiftUI
+import WorkspaceClient
+import TabBar
+
+extension View {
+ func tabBarContextMenu(item: TabBarItemRepresentable,
+ workspace: WorkspaceDocum... | CodeEdit/TabBar/TabBarContextMenu.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add Tab right-click Actions | 648 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/TabBar/TabBarContextMenu.swift
PR Title: Add Tab right-click Actions
BEFORE CODE: Button("Close Other Tabs") {
withAnimation {
workspace.closeTab(where: { $0 != item.tabID })
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return "folder.fill.badge.gearshape"
}
return children.isEmpty ? "folder" : "folder.fill"
}
/// Returns the file name with optional extension (e.g.: `Package.swift`)
public func fileName(typeHidden: Bool) -> String {
typeHidden ? url.deletingP... | No issues found. | return "folder.fill.badge.gearshape"
}
return children.isEmpty ? "folder" : "folder.fill"
}
/// Returns the file name with optional extension (e.g.: `Package.swift`)
public func fileName(typeHidden: Bool) -> String {
typeHidden ? url.deletingP... | @@ -154,10 +154,27 @@ public extension WorkspaceClient {
NSWorkspace.shared.activateFileViewerSelecting([url])
}
+ /// Allows the user to launch the file or folder as it would be in finder
+ public func openWithExternalEditor() {
+ NSWorkspace.shared.open(url)
+ }... | CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Implement Delete, Create File, Create Folder for the right click menu in ProjectNavigator | 655 | CodeEditApp/CodeEdit | 18,361 | Swift | KaiTheRedNinja | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift
PR Title: Implement Delete, Create File, Create Folder for the right click menu in ProjectNavigator
BEFORE CODE: return "folder.fill.badge.gearshape"
}
retu... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
//
// String+SHA256.swift
// CodeEdit
//
// Created by Debdut Karmakar on 6/9/22.
//
import Foundation
import CryptoKit
extension String {
/// Returns a SHA256 hash string of a string or nil
var sha256Hash: String? {
guard let data = self.data(using: .utf8) else { return nil }
let hash = SH... | No issues found. | //
// String+SHA256.swift
// CodeEdit
//
// Created by Debdut Karmakar on 6/9/22.
//
import Foundation
import CryptoKit
extension String {
/// Returns a SHA256 hash string of a string or nil
var sha256Hash: String? {
guard let data = self.data(using: .utf8) else { return nil }
let hash = SH... | @@ -0,0 +1,18 @@
+//
+// String+SHA256.swift
+// CodeEdit
+//
+// Created by Debdut Karmakar on 6/9/22.
+//
+
+import Foundation
+import CryptoKit
+
+extension String {
+ /// Returns a SHA256 hash string of a string or nil
+ var sha256Hash: String? {
+ guard let data = self.data(using: .utf8) else { ret... | CodeEdit/Extensions/String+SHA256.swift | 0 | Swift | 1 | none | 16 | 19 | 19 | true | Move UI Workspace configuration from project .codeedit/selection.json to UserDefaults/AppStorage #513 | 656 | CodeEditApp/CodeEdit | 18,361 | Swift | Debdut | Review this pull request change.
Language: Swift
File: CodeEdit/Extensions/String+SHA256.swift
PR Title: Move UI Workspace configuration from project .codeedit/selection.json to UserDefaults/AppStorage #513
BEFORE CODE: //
// String+SHA256.swift
// CodeEdit
//
// Created by Debdut Karmakar on 6/9/22.
//
import ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return item.children?.count ?? 0
}
return content.count
}
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
if let item = item as? Item,
let children = item.children {
return children[index]
}
... | No issues found. | return item.children?.count ?? 0
}
return content.count
}
func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
if let item = item as? Item,
let children = item.children {
return children[index]
}
... | @@ -210,7 +210,7 @@ extension OutlineViewController: NSOutlineViewDelegate {
}
func outlineView(_ outlineView: NSOutlineView, heightOfRowByItem item: Any) -> CGFloat {
- rowHeight // This can be changed to 20 to match Xcodes row height.
+ rowHeight // This can be changed to 20 to match Xcode's... | CodeEdit/NavigatorSidebar/ProjectNavigator/OutlineView/OutlineViewController.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Improving comments | 664 | CodeEditApp/CodeEdit | 18,361 | Swift | itsliamdowd | Review this pull request change.
Language: Swift
File: CodeEdit/NavigatorSidebar/ProjectNavigator/OutlineView/OutlineViewController.swift
PR Title: Improving comments
BEFORE CODE: return item.children?.count ?? 0
}
return content.count
}
func outlineView(_ outlineView: NSOutline... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Text("Monochrome")
.tag(AppPreferences.FileIconStyle.monochrome)
}
.pickerStyle(.radioGroup)
}
}
var tabBarStyleSection: some View {
PreferencesSection("Tab Bar Style") {
Picker("Tab Bar Style:", selection: $prefs.preferenc... | No issues found. | Text("Monochrome")
.tag(AppPreferences.FileIconStyle.monochrome)
}
.pickerStyle(.radioGroup)
}
}
var tabBarStyleSection: some View {
PreferencesSection("Tab Bar Style") {
Picker("Tab Bar Style:", selection: $prefs.preferenc... | @@ -49,6 +49,7 @@ public struct GeneralPreferencesView: View {
Group {
openInCodeEditToggle
revealFileOnFocusChangeToggle
+ shellCommandSection
}
}
}
@@ -208,6 +209,73 @@ private extension GeneralPreferencesView {
.disable... | CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Implement Basic CLI (#17) | 667 | CodeEditApp/CodeEdit | 18,361 | Swift | benkoska | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Sections/GeneralPreferences/GeneralPreferencesView.swift
PR Title: Implement Basic CLI (#17)
BEFORE CODE: Text("Monochrome")
.tag(AppPreferences.FileIconStyle.monochrome)
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if lineContainsSearchTerm(line: noSpaceLine, term: textToCompare) {
if fileAddedFlag {
searchResult.append(SearchResultModel(
file: fileItem,
lineNumber: nil,
... | No issues found. | if lineContainsSearchTerm(line: noSpaceLine, term: textToCompare) {
if fileAddedFlag {
searchResult.append(SearchResultModel(
file: fileItem,
lineNumber: nil,
... | @@ -12,59 +12,146 @@ import WorkspaceClient
extension WorkspaceDocument {
final class SearchState: ObservableObject {
var workspace: WorkspaceDocument
+ var selectedMode: [SearchModeModel] = [
+ .Find,
+ .Text,
+ .Containing
+ ]
@Published var searc... | CodeEdit/Documents/WorkspaceDocument+Search.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Find navigator improvements | 678 | CodeEditApp/CodeEdit | 18,361 | Swift | KaiTheRedNinja | Review this pull request change.
Language: Swift
File: CodeEdit/Documents/WorkspaceDocument+Search.swift
PR Title: Find navigator improvements
BEFORE CODE: if lineContainsSearchTerm(line: noSpaceLine, term: textToCompare) {
if fileAddedFlag {
s... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
//
// OtherFileView.swift
//
//
// Created by Shibo Tong on 10/7/2022.
//
import SwiftUI
import QuickLookUI
/// A SwiftUI Wrapper for `QLPreviewView`
/// Mainly used for other unsupported files
/// ## Usage
/// ```swift
/// OtherFileView(otherFile)
/// ```
public struct OtherFileView: NSViewRepresentable {
p... | No issues found. | //
// OtherFileView.swift
//
//
// Created by Shibo Tong on 10/7/2022.
//
import SwiftUI
import QuickLookUI
/// A SwiftUI Wrapper for `QLPreviewView`
/// Mainly used for other unsupported files
/// ## Usage
/// ```swift
/// OtherFileView(otherFile)
/// ```
public struct OtherFileView: NSViewRepresentable {
p... | @@ -0,0 +1,45 @@
+//
+// OtherFileView.swift
+//
+//
+// Created by Shibo Tong on 10/7/2022.
+//
+
+import SwiftUI
+import QuickLookUI
+
+/// A SwiftUI Wrapper for `QLPreviewView`
+/// Mainly used for other unsupported files
+/// ## Usage
+/// ```swift
+/// OtherFileView(otherFile)
+/// ```
+public struct OtherFile... | CodeEditModules/Modules/CodeFile/src/Other/OtherFileView.swift | 0 | Swift | 1 | none | 16 | 46 | 46 | true | Fix open unsupported Documents, support for open image files | 679 | CodeEditApp/CodeEdit | 18,361 | Swift | shibotong | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/CodeFile/src/Other/OtherFileView.swift
PR Title: Fix open unsupported Documents, support for open image files
BEFORE CODE: //
// OtherFileView.swift
//
//
// Created by Shibo Tong on 10/7/2022.
//
import SwiftUI
import QuickLookUI
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// Returns a string describing a SFSymbol for folders
///
/// If it is the top-level folder this will return `"square.dashed.inset.filled"`.
/// If it is a `.codeedit` folder this will return `"folder.fill.badge.gearshape"`.
/// If it has children this will return `"folder.fill... | No issues found. |
/// Returns a string describing a SFSymbol for folders
///
/// If it is the top-level folder this will return `"square.dashed.inset.filled"`.
/// If it is a `.codeedit` folder this will return `"folder.fill.badge.gearshape"`.
/// If it has children this will return `"folder.fill... | @@ -33,6 +33,24 @@ public extension WorkspaceClient {
public typealias ID = String
+ public var watcher: DispatchSourceFileSystemObject?
+ static var watcherCode: () -> Void = {}
+
+ public func activateWatcher() -> Bool {
+ let descriptor = open(self.url.path, O_EVTONLY)
+ ... | CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Project sidebar loading optimisation | 686 | CodeEditApp/CodeEdit | 18,361 | Swift | KaiTheRedNinja | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/WorkspaceClient/src/Model/FileItem.swift
PR Title: Project sidebar loading optimisation
BEFORE CODE:
/// Returns a string describing a SFSymbol for folders
///
/// If it is the top-level folder this will return `... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
folderURL: directory,
ignoredFilesAndFolders: []
)
var newFiles: [WorkspaceClient.FileItem] = []
cancellable = client
.getFiles
.sink { files in
newFiles = files
expectation.fulfill()
}
waitFor... | No issues found. | folderURL: directory,
ignoredFilesAndFolders: []
)
var newFiles: [WorkspaceClient.FileItem] = []
cancellable = client
.getFiles
.sink { files in
newFiles = files
expectation.fulfill()
}
waitFor... | @@ -69,8 +69,7 @@ final class WorkspaceClientUnitTests: XCTestCase {
try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)
var cancellable: AnyCancellable?
- let expectation = expectation(description: "wait for files")
- expectation.expectedFulfillme... | CodeEditModules/Modules/WorkspaceClient/Tests/UnitTests.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add duplicate file functionality | 736 | CodeEditApp/CodeEdit | 18,361 | Swift | Muhammed9991 | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/WorkspaceClient/Tests/UnitTests.swift
PR Title: Add duplicate file functionality
BEFORE CODE: folderURL: directory,
ignoredFilesAndFolders: []
)
var newFiles: [WorkspaceClient.FileItem] = []
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.toggleFirstSidebarItem,
.sidebarTrackingSeparator,
.branchPicker,
.flexibleSpace,
.flexibleSpace,
.toggleLastSidebarIte... | No issues found. |
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.toggleFirstSidebarItem,
.sidebarTrackingSeparator,
.branchPicker,
.flexibleSpace,
.flexibleSpace,
.toggleLastSidebarIte... | @@ -44,20 +44,20 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate {
func registerCommands() {
CommandManager.shared.addCommand(
name: "Quick Open",
- title: "Quick Open",
- id: "quick_open",
- command: ClosureWrapper(closure: {... | CodeEdit/Documents/CodeEditWindowController.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Sparkle updates | 759 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | Review this pull request change.
Language: Swift
File: CodeEdit/Documents/CodeEditWindowController.swift
PR Title: Sparkle updates
BEFORE CODE:
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.toggleFirstSidebarItem,
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
private var cancellables = [AnyCancellable]()
private let editable: Bool
public init(codeFile: CodeFileDocument, editable: Bool = true) {
self.codeFile = codeFile
self.editable = editable
codeFile
.$content
.dropFirst()
.debounce(
... | No issues found. |
private var cancellables = [AnyCancellable]()
private let editable: Bool
public init(codeFile: CodeFileDocument, editable: Bool = true) {
self.codeFile = codeFile
self.editable = editable
codeFile
.$content
.dropFirst()
.debounce(
... | @@ -10,6 +10,7 @@ import Foundation
import SwiftUI
import CodeEditTextView
import AppPreferences
+import Combine
/// CodeFileView is just a wrapper of the `CodeEditor` dependency
public struct CodeFileView: View {
@@ -22,11 +23,34 @@ public struct CodeFileView: View {
@Environment(\.colorScheme)
privat... | CodeEditModules/Modules/CodeFile/src/CodeFileView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add preferences option to toggle auto-save. | 763 | CodeEditApp/CodeEdit | 18,361 | Swift | sk409 | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/CodeFile/src/CodeFileView.swift
PR Title: Add preferences option to toggle auto-save.
BEFORE CODE:
private var cancellables = [AnyCancellable]()
private let editable: Bool
public init(codeFile: CodeFileDocument, editable: ... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// },
/// ...
/// }
/// }
/// ```
typealias ThemeOverrides = [String: [String: Theme.Attributes]]
/// The global settings for themes
struct ThemePreferences: Codable {
/// The name of the currently selected dark theme
public var selectedDarkTheme: String = "c... | No issues found. | /// },
/// ...
/// }
/// }
/// ```
typealias ThemeOverrides = [String: [String: Theme.Attributes]]
/// The global settings for themes
struct ThemePreferences: Codable {
/// The name of the currently selected dark theme
public var selectedDarkTheme: String = "c... | @@ -32,14 +32,20 @@ public extension AppPreferences {
/// The global settings for themes
struct ThemePreferences: Codable {
+ /// The name of the currently selected dark theme
+ public var selectedDarkTheme: String = "codeedit-xcode-dark"
+
+ /// The name of the currently selected light... | CodeEditModules/Modules/AppPreferences/src/Model/Theme/ThemePreferences.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Fixes 714: Theme does not sync with system appearance | 765 | CodeEditApp/CodeEdit | 18,361 | Swift | matthijseikelenboom | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Model/Theme/ThemePreferences.swift
PR Title: Fixes 714: Theme does not sync with system appearance
BEFORE CODE: /// },
/// ...
/// }
/// }
/// ```
typealias ThemeOverrides = [String: [... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if !filemanager.fileExists(atPath: url.path, isDirectory: &isDir) {
try filemanager.createDirectory(at: url, withIntermediateDirectories: true)
}
try loadBundledThemes()
// get all filenames in themes folder that end with `.json`
let content = try filemanager.conten... | No issues found. | if !filemanager.fileExists(atPath: url.path, isDirectory: &isDir) {
try filemanager.createDirectory(at: url, withIntermediateDirectories: true)
}
try loadBundledThemes()
// get all filenames in themes folder that end with `.json`
let content = try filemanager.conten... | @@ -18,6 +18,19 @@ public final class ThemeModel: ObservableObject {
public static let shared: ThemeModel = .init()
+ /// Default instance of the `FileManager`
+ private let filemanager = FileManager.default
+
+ /// The base folder url `~/Library/Application Support/CodeEdit/`
+ private var baseURL... | CodeEditModules/Modules/AppPreferences/src/Sections/ThemePreferences/Model/ThemeModel.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Moved Themes and Preferences to Application Support | 827 | CodeEditApp/CodeEdit | 18,361 | Swift | austincondiff | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/AppPreferences/src/Sections/ThemePreferences/Model/ThemeModel.swift
PR Title: Moved Themes and Preferences to Application Support
BEFORE CODE: if !filemanager.fileExists(atPath: url.path, isDirectory: &isDir) {
try fi... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/*
This is the main type of the document.
For example, if the file is end with '.png', it will be an image,
if the file is end with '.py', it will be a text file.
If text content is not empty, return text
If its neither image or text, this could be nil.
*/
public var typeOfFile: UT... | No issues found. |
/*
This is the main type of the document.
For example, if the file is end with '.png', it will be an image,
if the file is end with '.py', it will be a text file.
If text content is not empty, return text
If its neither image or text, this could be nil.
*/
public var typeOfFile: UT... | @@ -57,6 +57,9 @@ public final class CodeFileDocument: NSDocument, ObservableObject, QLPreviewItem
fileURL
}
+ @Published
+ public var cursorPosition = (1, 1)
+
// MARK: - NSDocument
override public class var autosavesInPlace: Bool { | CodeEditModules/Modules/CodeFile/src/CodeFile.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add ability to open files using `codeedit://` URLs. | 840 | CodeEditApp/CodeEdit | 18,361 | Swift | ezraberch | Review this pull request change.
Language: Swift
File: CodeEditModules/Modules/CodeFile/src/CodeFile.swift
PR Title: Add ability to open files using `codeedit://` URLs.
BEFORE CODE:
/*
This is the main type of the document.
For example, if the file is end with '.png', it will be an image,
if the... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
func testSplitViewControllerSnappedWhenWidthInAppropriateRange() {
// Given
let position = (260...280).randomElement() ?? .zero
// When
let result = splitViewController.splitView(
splitViewController.splitView,
constrainSplitPosition: .init(position),
... | No issues found. | func testSplitViewControllerSnappedWhenWidthInAppropriateRange() {
// Given
let position = (260...280).randomElement() ?? .zero
// When
let result = splitViewController.splitView(
splitViewController.splitView,
constrainSplitPosition: .init(position),
... | @@ -0,0 +1,111 @@
+//
+// DocumentsUnitTests.swift
+// CodeEditTests
+//
+// Created by YAPRYNTSEV Aleksey on 31.12.2022.
+//
+
+import XCTest
+@testable import CodeEdit
+
+final class DocumentsUnitTests: XCTestCase {
+ // Properties
+ private var splitViewController: CodeEditSplitViewController!
+ private ... | CodeEditTests/Features/Documents/DocumentsUnitTests.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Snap Sidebar To Width | 882 | CodeEditApp/CodeEdit | 18,361 | Swift | yapryntsev | Review this pull request change.
Language: Swift
File: CodeEditTests/Features/Documents/DocumentsUnitTests.swift
PR Title: Snap Sidebar To Width
BEFORE CODE: func testSplitViewControllerSnappedWhenWidthInAppropriateRange() {
// Given
let position = (260...280).randomElement() ?? .zero
/... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
import Cocoa
private extension CGFloat {
static let snapWidth: CGFloat = 272
static let minSnapWidth: CGFloat = snapWidth - 10
static let maxSnapWidth: CGFloat = snapWidth + 10
}
final class CodeEditSplitViewController: NSSplitViewController {
// Properties
private(set) var isSnapped: Bool = fal... | No issues found. |
import Cocoa
private extension CGFloat {
static let snapWidth: CGFloat = 272
static let minSnapWidth: CGFloat = snapWidth - 10
static let maxSnapWidth: CGFloat = snapWidth + 10
}
final class CodeEditSplitViewController: NSSplitViewController {
// Properties
private(set) var isSnapped: Bool = fal... | @@ -8,7 +8,7 @@
import Cocoa
private extension CGFloat {
- static let snapWidth: CGFloat = 270
+ static let snapWidth: CGFloat = 272
static let minSnapWidth: CGFloat = snapWidth - 10
static let maxSnapWidth: CGFloat = snapWidth + 10 | CodeEdit/Features/Documents/Controllers/CodeEditSplitViewController.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | fix for icon size | 920 | CodeEditApp/CodeEdit | 18,361 | Swift | Wouter01 | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditSplitViewController.swift
PR Title: fix for icon size
BEFORE CODE:
import Cocoa
private extension CGFloat {
static let snapWidth: CGFloat = 272
static let minSnapWidth: CGFloat = snapWidth - 10
stat... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return formatter
}
var body: some View {
PreferencesContent {
PreferencesSection("Default Tab Width") {
HStack(spacing: 5) {
TextField("", value: $prefs.preferences.textEditing.defaultTabWidth, formatter: numberFormat)
.mu... | No issues found. |
return formatter
}
var body: some View {
PreferencesContent {
PreferencesSection("Default Tab Width") {
HStack(spacing: 5) {
TextField("", value: $prefs.preferences.textEditing.defaultTabWidth, formatter: numberFormat)
.mu... | @@ -42,6 +42,9 @@ struct TextEditingPreferencesView: View {
autocompleteBraces
enableTypeOverCompletion
}
+ PreferencesSection("Line Wrapping") {
+ wrapLinesToEditorWidth
+ }
}
}
@@ -75,4 +78,12 @@ struct TextEditingPref... | CodeEdit/Features/AppPreferences/Sections/TextEditingPreferences/TextEditingPreferencesView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add preference for text wrapping in editor, add command palette options for text editing prefs | 948 | CodeEditApp/CodeEdit | 18,361 | Swift | ben-p-commits | Review this pull request change.
Language: Swift
File: CodeEdit/Features/AppPreferences/Sections/TextEditingPreferences/TextEditingPreferencesView.swift
PR Title: Add preference for text wrapping in editor, add command palette options for text editing prefs
BEFORE CODE:
return formatter
}
var body... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/// A multiplier for setting the line height. Defaults to `1.45`
var lineHeightMultiple: Double = 1.45
/// Default initializer
init() {
self.populateCommands()
}
/// Explicit decoder init for setting default values when key is not present in `JSON`
i... | No issues found. | /// A multiplier for setting the line height. Defaults to `1.45`
var lineHeightMultiple: Double = 1.45
/// Default initializer
init() {
self.populateCommands()
}
/// Explicit decoder init for setting default values when key is not present in `JSON`
i... | @@ -17,13 +17,18 @@ extension AppPreferences {
/// The font to use in editor.
var font: EditorFont = .init()
+ /// A flag indicating whether type-over completion is enabled
var enableTypeOverCompletion: Bool = true
+ /// A flag indicating whether braces are automatically com... | CodeEdit/Features/AppPreferences/Model/Text Editing/TextEditingPreferences.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Add line height multiple option to text editing preferences | 955 | CodeEditApp/CodeEdit | 18,361 | Swift | ben-p-commits | Review this pull request change.
Language: Swift
File: CodeEdit/Features/AppPreferences/Model/Text Editing/TextEditingPreferences.swift
PR Title: Add line height multiple option to text editing preferences
BEFORE CODE: /// A multiplier for setting the line height. Defaults to `1.45`
var lineHeightMu... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
//
// AcknowledgementsTests.swift
// CodeEditTests
//
// Created by Lukas Pistrol on 14.01.23.
//
import XCTest
@testable import CodeEdit
final class AcknowledgementsTests: XCTestCase {
var model: AcknowledgementsViewModel!
override func setUpWithError() throws {
model = .init()
}
overri... | No issues found. | //
// AcknowledgementsTests.swift
// CodeEditTests
//
// Created by Lukas Pistrol on 14.01.23.
//
import XCTest
@testable import CodeEdit
final class AcknowledgementsTests: XCTestCase {
var model: AcknowledgementsViewModel!
override func setUpWithError() throws {
model = .init()
}
overri... | @@ -0,0 +1,26 @@
+//
+// AcknowledgementsTests.swift
+// CodeEditTests
+//
+// Created by Lukas Pistrol on 14.01.23.
+//
+
+import XCTest
+@testable import CodeEdit
+
+final class AcknowledgementsTests: XCTestCase {
+
+ var model: AcknowledgementsViewModel!
+
+ override func setUpWithError() throws {
+ ... | CodeEditTests/Features/Acknowledgements/AcknowledgementsTests.swift | 0 | Swift | 1 | none | 16 | 27 | 27 | true | [fix]: Acknowledgements Window | 963 | CodeEditApp/CodeEdit | 18,361 | Swift | lukepistrol | Review this pull request change.
Language: Swift
File: CodeEditTests/Features/Acknowledgements/AcknowledgementsTests.swift
PR Title: [fix]: Acknowledgements Window
BEFORE CODE: //
// AcknowledgementsTests.swift
// CodeEditTests
//
// Created by Lukas Pistrol on 14.01.23.
//
import XCTest
@testable import CodeEd... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.toggleFirstSidebarItem,
.sidebarTrackingSeparator,
.branchPicker,
.flexibleSpace,
.flexibleSpace,
.toggleLastSide... | No issues found. | }
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.toggleFirstSidebarItem,
.sidebarTrackingSeparator,
.branchPicker,
.flexibleSpace,
.flexibleSpace,
.toggleLastSide... | @@ -9,6 +9,8 @@ import Cocoa
import SwiftUI
final class CodeEditWindowController: NSWindowController, NSToolbarDelegate {
+ static let minSidebarWidth: CGFloat = 242
+
private var prefs: AppPreferencesModel = .shared
var workspace: WorkspaceDocument?
@@ -73,7 +75,7 @@ final class CodeEditWindowContro... | CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Resize inspector | 970 | CodeEditApp/CodeEdit | 18,361 | Swift | thecoolwinter | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift
PR Title: Resize inspector
BEFORE CODE: }
// MARK: - Toolbar
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
[
.tog... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
selectionState.openFileItems.remove(at: openFileItemIndex)
removeTab(id: item.tabID)
if openedTabsFromState {
var openTabsInState = self.getFromWorkspaceState(key: openTabsStateName) as? [String] ?? []
if let index = openTabsInState.firstIndex(of: item.url.absoluteString... | No issues found. | selectionState.openFileItems.remove(at: openFileItemIndex)
removeTab(id: item.tabID)
if openedTabsFromState {
var openTabsInState = self.getFromWorkspaceState(key: openTabsStateName) as? [String] ?? []
if let index = openTabsInState.firstIndex(of: item.url.absoluteString... | @@ -22,12 +22,27 @@ import CodeEditKit
@Published var selectionState: WorkspaceSelectionState = .init()
@Published var fileItems: [WorkspaceClient.FileItem] = []
+ var workspaceState: [String: Any] {
+ get {
+ let key = "workspaceState-\(self.fileURL?.absoluteString ?? "")"
+ ... | CodeEdit/Features/Documents/WorkspaceDocument.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Save UI state per Workspace | 984 | CodeEditApp/CodeEdit | 18,361 | Swift | Code-DJ | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Documents/WorkspaceDocument.swift
PR Title: Save UI state per Workspace
BEFORE CODE: selectionState.openFileItems.remove(at: openFileItemIndex)
removeTab(id: item.tabID)
if openedTabsFromState {
var openTab... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
Spacer()
HStack(alignment: .top) {
if let profileURL = contributor.profileURL, profileURL != contributor.gitHubURL {
ActionButton(url: profileURL, image: .init(systemName: "globe"))
}
if let gitHubURL = contributor.gitHubURL {
... | No issues found. | Spacer()
HStack(alignment: .top) {
if let profileURL = contributor.profileURL, profileURL != contributor.gitHubURL {
ActionButton(url: profileURL, image: .init(systemName: "globe"))
}
if let gitHubURL = contributor.gitHubURL {
... | @@ -0,0 +1,104 @@
+//
+// ContributorRowView.swift
+// CodeEdit
+//
+// Created by Lukas Pistrol on 19.01.23.
+//
+
+import SwiftUI
+
+struct ContributorRowView: View {
+
+ let contributor: Contributor
+
+ var body: some View {
+ HStack {
+ userImage
+ VStack(alignment: .leading, s... | CodeEdit/Features/Contributors/ContributorRowView.swift | 0 | Swift | 1 | none | 16 | 51 | 51 | true | Feat/contributors window | 1,002 | CodeEditApp/CodeEdit | 18,361 | Swift | lukepistrol | Review this pull request change.
Language: Swift
File: CodeEdit/Features/Contributors/ContributorRowView.swift
PR Title: Feat/contributors window
BEFORE CODE: Spacer()
HStack(alignment: .top) {
if let profileURL = contributor.profileURL, profileURL != contributor.gitHubURL {
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.