Skip to content

Commit f75a36d

Browse files
committed
2 parents d1c1861 + 2fa420d commit f75a36d

File tree

174 files changed

+4881
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+4881
-1035
lines changed

.all-contributorsrc

+39-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"login": "lukepistrol",
20-
"name": "Lukas",
20+
"name": "Lukas Pistrol",
2121
"avatar_url": "https://avatars.githubusercontent.com/u/9460130?v=4",
2222
"profile": "http://lukaspistrol.com",
2323
"contributions": [
@@ -149,6 +149,44 @@
149149
"infra",
150150
"plugin"
151151
]
152+
},
153+
{
154+
"login": "dzign1",
155+
"name": "Rob Hughes",
156+
"avatar_url": "https://avatars.githubusercontent.com/u/44317715?v=4",
157+
"profile": "https://github.com/dzign1",
158+
"contributions": [
159+
"code"
160+
]
161+
},
162+
{
163+
"login": "lilingxi01",
164+
"name": "Lingxi Li",
165+
"avatar_url": "https://avatars.githubusercontent.com/u/36816148?v=4",
166+
"profile": "https://lingxi.li",
167+
"contributions": [
168+
"code",
169+
"bug"
170+
]
171+
},
172+
{
173+
"login": "octree",
174+
"name": "HZ.Liu",
175+
"avatar_url": "https://avatars.githubusercontent.com/u/7934444?v=4",
176+
"profile": "https://github.com/octree",
177+
"contributions": [
178+
"code",
179+
"bug"
180+
]
181+
},
182+
{
183+
"login": "richardtop",
184+
"name": "Richard Topchii",
185+
"avatar_url": "https://avatars.githubusercontent.com/u/8013017?v=4",
186+
"profile": "https://www.youtube.com/channel/UCx1gvWpy5zjOd7yZyDwmXEA?sub_confirmation=1",
187+
"contributions": [
188+
"code"
189+
]
152190
}
153191
],
154192
"contributorsPerLine": 7,

CodeEdit.xcodeproj/project.pbxproj

+132-44
Large diffs are not rendered by default.

CodeEdit.xcworkspace/xcshareddata/swiftpm/Package.resolved

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@
1010
"version": null
1111
}
1212
},
13+
{
14+
"package": "CodeEditSymbols",
15+
"repositoryURL": "https://github.com/CodeEditApp/CodeEditSymbols",
16+
"state": {
17+
"branch": "main",
18+
"revision": "51ab9b4e7e6434ce8e2c74b04a6ba2591b972bb1",
19+
"version": null
20+
}
21+
},
1322
{
1423
"package": "GRDB",
1524
"repositoryURL": "https://github.com/groue/GRDB.swift.git",
1625
"state": {
1726
"branch": null,
18-
"revision": "15c06e037430c8a2dc570f9199dd7bf8caa21195",
19-
"version": "5.22.2"
27+
"revision": "4472d3a60ec4cc383503eba5072ce17f781b9ddc",
28+
"version": "5.23.0"
2029
}
2130
},
2231
{
@@ -63,15 +72,6 @@
6372
"revision": "70a3af884c24dff9f1beeda04e889b5591f04f3c",
6473
"version": "1.0.7"
6574
}
66-
},
67-
{
68-
"package": "Introspect",
69-
"repositoryURL": "https://github.com/siteline/SwiftUI-Introspect",
70-
"state": {
71-
"branch": null,
72-
"revision": "f2616860a41f9d9932da412a8978fec79c06fe24",
73-
"version": "0.1.4"
74-
}
7575
}
7676
]
7777
},

CodeEdit/AppDelegate.swift

+21-13
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@ import Preferences
1111
import About
1212
import WelcomeModule
1313
import ExtensionsStore
14+
import Feedback
15+
import CodeEditSymbols
1416

15-
class CodeEditApplication: NSApplication {
17+
final class CodeEditApplication: NSApplication {
1618
let strongDelegate = AppDelegate()
1719

1820
override init() {
1921
super.init()
2022
self.delegate = strongDelegate
2123
}
2224

25+
@available(*, unavailable)
2326
required init?(coder: NSCoder) {
2427
fatalError("init(coder:) has not been implemented")
2528
}
2629

2730
}
2831

2932
@NSApplicationMain
30-
class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
33+
final class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
3134
func applicationWillFinishLaunching(_ notification: Notification) {
3235
_ = CodeEditDocumentController.shared
3336
}
@@ -54,12 +57,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
5457
}
5558
}
5659

57-
DispatchQueue(label: "extensions.preload").async {
58-
do {
59-
try ExtensionsManager.shared?.preload()
60-
} catch let error {
61-
print(error)
62-
}
60+
do {
61+
try ExtensionsManager.shared?.preload()
62+
} catch let error {
63+
print(error)
6364
}
6465
}
6566

@@ -145,9 +146,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
145146
}
146147

147148
} else {
148-
CodeEditDocumentController.shared.openDocument { _, _ in
149+
windowController.window?.close()
150+
CodeEditDocumentController.shared.openDocument(onCompletion: { _, _ in
149151
opened()
150-
}
152+
}, onCancel: {
153+
self.openWelcome(self)
154+
})
151155
}
152156
},
153157
newDocument: {
@@ -167,6 +171,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
167171
AboutView().showWindow(width: 530, height: 220)
168172
}
169173

174+
@IBAction func openFeedback(_ sender: Any) {
175+
FeedbackView().showWindow()
176+
}
177+
170178
// MARK: - Preferences
171179

172180
private lazy var preferencesWindowController = PreferencesWindowController(
@@ -183,7 +191,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
183191
title: "Accounts",
184192
toolbarIcon: NSImage(systemSymbolName: "at", accessibilityDescription: nil)!
185193
) {
186-
PreferencesPlaceholderView()
194+
PreferenceAccountsView()
187195
},
188196
Preferences.Pane(
189197
identifier: Preferences.PaneIdentifier("Behaviors"),
@@ -231,9 +239,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
231239
Preferences.Pane(
232240
identifier: Preferences.PaneIdentifier("SourceControl"),
233241
title: "Source Control",
234-
toolbarIcon: NSImage(systemSymbolName: "square.stack", accessibilityDescription: nil)!
242+
toolbarIcon: NSImage.vault
235243
) {
236-
PreferencesPlaceholderView()
244+
PreferenceSourceControlView()
237245
},
238246
Preferences.Pane(
239247
identifier: Preferences.PaneIdentifier("Components"),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0xE1",
9+
"green" : "0xE1",
10+
"red" : "0xE1"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0x59",
27+
"green" : "0x59",
28+
"red" : "0x59"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}

CodeEdit/Documents/CodeEditDocumentController.swift

+8-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import Cocoa
99

10-
class CodeEditDocumentController: NSDocumentController {
10+
final class CodeEditDocumentController: NSDocumentController {
1111
override func openDocument(_ sender: Any?) {
12-
self.openDocument { document, documentWasAlreadyOpen in
12+
self.openDocument(onCompletion: { document, documentWasAlreadyOpen in
1313
// TODO: handle errors
1414

1515
guard let document = document else {
@@ -18,7 +18,7 @@ class CodeEditDocumentController: NSDocumentController {
1818
}
1919

2020
print(document, documentWasAlreadyOpen)
21-
}
21+
}, onCancel: {})
2222
}
2323

2424
override func openDocument(withContentsOf url: URL,
@@ -41,7 +41,7 @@ class CodeEditDocumentController: NSDocumentController {
4141
}
4242

4343
extension NSDocumentController {
44-
func openDocument(completionHandler: @escaping (NSDocument?, Bool) -> Void) {
44+
final func openDocument(onCompletion: @escaping (NSDocument?, Bool) -> Void, onCancel: @escaping () -> Void) {
4545
let dialog = NSOpenPanel()
4646

4747
dialog.title = "Open Workspace or File"
@@ -66,15 +66,17 @@ extension NSDocumentController {
6666
return
6767
}
6868
self.updateRecent(url)
69-
completionHandler(document, documentWasAlreadyOpen)
69+
onCompletion(document, documentWasAlreadyOpen)
7070
print("Document:", document)
7171
print("Was already open?", documentWasAlreadyOpen)
7272
}
73+
} else if result == NSApplication.ModalResponse.cancel {
74+
onCancel()
7375
}
7476
}
7577
}
7678

77-
func updateRecent(_ url: URL) {
79+
final func updateRecent(_ url: URL) {
7880
var recentProjectPaths: [String] = UserDefaults.standard.array(
7981
forKey: "recentProjectPaths"
8082
) as? [String] ?? []

CodeEdit/Documents/CodeEditWindowController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Cocoa
99
import SwiftUI
1010
import CodeFile
11-
import Overlays
11+
import CodeEditUI
1212
import QuickOpen
1313

1414
final class CodeEditWindowController: NSWindowController, NSToolbarDelegate {
@@ -29,6 +29,7 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate {
2929
setupToolbar()
3030
}
3131

32+
@available(*, unavailable)
3233
required init?(coder: NSCoder) {
3334
fatalError("init(coder:) has not been implemented")
3435
}

CodeEdit/Documents/WorkspaceCodeFileView.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SwiftUI
99
import CodeFile
1010
import WorkspaceClient
1111
import StatusBar
12+
import Breadcrumbs
1213

1314
struct WorkspaceCodeFileView: View {
1415
var windowController: NSWindowController
@@ -28,7 +29,7 @@ struct WorkspaceCodeFileView: View {
2829
VStack(spacing: 0) {
2930
TabBar(windowController: windowController, workspace: workspace)
3031
Divider()
31-
BreadcrumbsView(item, workspace: workspace)
32+
BreadcrumbsView(file: item, tappedOpenFile: workspace.openFile(item:))
3233
}
3334
}
3435
} else {

CodeEdit/Documents/WorkspaceDocument.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import CodeEditKit
1717
import ExtensionsStore
1818

1919
@objc(WorkspaceDocument)
20-
class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
20+
final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
2121
var workspaceClient: WorkspaceClient?
2222

2323
var extensionNavigatorData = ExtensionNavigatorData()
@@ -87,7 +87,9 @@ class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
8787

8888
selectionState.openedCodeFiles[item] = codeFile
8989
}
90-
selectionState.selectedId = item.id
90+
if selectionState.selectedId != item.id {
91+
selectionState.selectedId = item.id
92+
}
9193
Swift.print("Opening file for item: ", item.url)
9294
self.windowControllers.first?.window?.subtitle = item.url.lastPathComponent
9395
} catch let err {
@@ -234,7 +236,7 @@ class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
234236
// MARK: - Search
235237

236238
extension WorkspaceDocument {
237-
class SearchState: ObservableObject {
239+
final class SearchState: ObservableObject {
238240
var workspace: WorkspaceDocument
239241
@Published var searchResult: [SearchResultModel] = []
240242

CodeEdit/Extensions/CodeEditAPI.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99
import CodeEditKit
1010

11-
class CodeEditAPI: ExtensionAPI {
11+
final class CodeEditAPI: ExtensionAPI {
1212
var extensionId: String
1313
var workspace: WorkspaceDocument
1414

CodeEdit/Extensions/CodeEditTargetsAPI.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99
import CodeEditKit
1010

11-
class CodeEditTargetsAPI: TargetsAPI {
11+
final class CodeEditTargetsAPI: TargetsAPI {
1212

1313
var workspace: WorkspaceDocument
1414

CodeEdit/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@
4545
</dict>
4646
</array>
4747
<key>GitHash</key>
48-
<string>cdaf6b982864a55727edc3b1b3201e689bc2ff6d</string>
48+
<string>d1c186114ad333f1047ba4b9eb0581c7aca9f941</string>
4949
</dict>
5050
</plist>

0 commit comments

Comments
 (0)