Skip to content

Commit c2ac9ae

Browse files
Lint errors, project item location fixes
1 parent 45a3d79 commit c2ac9ae

19 files changed

+373
-179
lines changed

CodeEdit.xcodeproj/project.pbxproj

Lines changed: 143 additions & 85 deletions
Large diffs are not rendered by default.

CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"originHash" : "3f6921a5ec30d1ecb6d6b205cf27a816c318246bb00f0ea367b997cc66527d32",
2+
"originHash" : "9c699d730017e749c2b945e8435c6edd8169fe23742cc8fd8a58078ae48764ac",
33
"pins" : [
44
{
55
"identity" : "anycodable",
@@ -31,7 +31,7 @@
3131
{
3232
"identity" : "codeeditsourceeditor",
3333
"kind" : "remoteSourceControl",
34-
"location" : "https://github.com/CodeEditApp/CodeEditSourceEditor",
34+
"location" : "https://github.com/CodeEditApp/CodeEditSourceEditor.git",
3535
"state" : {
3636
"revision" : "7360f00bf7ec8e93b4833357bd254bef7e5c943d",
3737
"version" : "0.7.2"
@@ -51,8 +51,8 @@
5151
"kind" : "remoteSourceControl",
5252
"location" : "https://github.com/CodeEditApp/CodeEditTextView.git",
5353
"state" : {
54-
"revision" : "86b980464bcb67693e2053283c7a99bdc6f358bc",
55-
"version" : "0.7.3"
54+
"revision" : "80911be6bcdae5e35ef5ed351adf6dda9b57e555",
55+
"version" : "0.7.4"
5656
}
5757
},
5858
{
@@ -73,6 +73,24 @@
7373
"version" : "0.4.2"
7474
}
7575
},
76+
{
77+
"identity" : "fseventswrapper",
78+
"kind" : "remoteSourceControl",
79+
"location" : "https://github.com/Frizlab/FSEventsWrapper",
80+
"state" : {
81+
"revision" : "70bbea4b108221fcabfce8dbced8502831c0ae04",
82+
"version" : "2.1.0"
83+
}
84+
},
85+
{
86+
"identity" : "globpattern",
87+
"kind" : "remoteSourceControl",
88+
"location" : "https://github.com/ChimeHQ/GlobPattern",
89+
"state" : {
90+
"revision" : "4ebb9e89e07cc475efa74f87dc6d21f4a9e060f8",
91+
"version" : "0.1.1"
92+
}
93+
},
7694
{
7795
"identity" : "grdb.swift",
7896
"kind" : "remoteSourceControl",
@@ -82,10 +100,37 @@
82100
"version" : "5.26.1"
83101
}
84102
},
103+
{
104+
"identity" : "jsonrpc",
105+
"kind" : "remoteSourceControl",
106+
"location" : "https://github.com/ChimeHQ/JSONRPC",
107+
"state" : {
108+
"revision" : "c6ec759d41a76ac88fe7327c41a77d9033943374",
109+
"version" : "0.9.0"
110+
}
111+
},
112+
{
113+
"identity" : "languageclient",
114+
"kind" : "remoteSourceControl",
115+
"location" : "https://github.com/ChimeHQ/LanguageClient",
116+
"state" : {
117+
"revision" : "f8fdeaed850fbc3e542cd038e952758887f6be5d",
118+
"version" : "0.8.0"
119+
}
120+
},
121+
{
122+
"identity" : "languageserverprotocol",
123+
"kind" : "remoteSourceControl",
124+
"location" : "https://github.com/ChimeHQ/LanguageServerProtocol",
125+
"state" : {
126+
"revision" : "ac76fccf0e981c8e30c5ee4de1b15adc1decd697",
127+
"version" : "0.13.2"
128+
}
129+
},
85130
{
86131
"identity" : "logstream",
87132
"kind" : "remoteSourceControl",
88-
"location" : "https://github.com/CodeEditApp/LogStream",
133+
"location" : "https://github.com/Wouter01/LogStream",
89134
"state" : {
90135
"revision" : "6f83694b2675dcf3b1cea0a52546ff4469c18282",
91136
"version" : "1.3.0"
@@ -100,6 +145,24 @@
100145
"version" : "0.2.1"
101146
}
102147
},
148+
{
149+
"identity" : "processenv",
150+
"kind" : "remoteSourceControl",
151+
"location" : "https://github.com/ChimeHQ/ProcessEnv",
152+
"state" : {
153+
"revision" : "83f1ebc9dd6fb1db0bd89a3fcae00488a0f3fdd9",
154+
"version" : "1.0.0"
155+
}
156+
},
157+
{
158+
"identity" : "queue",
159+
"kind" : "remoteSourceControl",
160+
"location" : "https://github.com/mattmassicotte/Queue",
161+
"state" : {
162+
"revision" : "8d6f936097888f97011610ced40313655dc5948d",
163+
"version" : "0.1.4"
164+
}
165+
},
103166
{
104167
"identity" : "rearrange",
105168
"kind" : "remoteSourceControl",
@@ -109,6 +172,15 @@
109172
"version" : "1.8.1"
110173
}
111174
},
175+
{
176+
"identity" : "semaphore",
177+
"kind" : "remoteSourceControl",
178+
"location" : "https://github.com/groue/Semaphore",
179+
"state" : {
180+
"revision" : "f1c4a0acabeb591068dea6cffdd39660b86dec28",
181+
"version" : "0.0.8"
182+
}
183+
},
112184
{
113185
"identity" : "sparkle",
114186
"kind" : "remoteSourceControl",
@@ -150,8 +222,8 @@
150222
"kind" : "remoteSourceControl",
151223
"location" : "https://github.com/lukepistrol/SwiftLintPlugin",
152224
"state" : {
153-
"revision" : "ea6d3ca895b49910f790e98e4b4ca658e0fe490e",
154-
"version" : "0.54.0"
225+
"revision" : "a0f7b12c7be228592d924f29f654ebbd924ac9c5",
226+
"version" : "0.55.1"
155227
}
156228
},
157229
{

CodeEdit/Features/About/Views/AboutView.swift

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,13 @@ public struct AboutView: View {
4444
// if anyone knows of a better way to do this feel free to refactor
4545
.background(.regularMaterial.opacity(0))
4646
.background(EffectView(.popover, blendingMode: .behindWindow).ignoresSafeArea())
47-
// .background {
48-
// Button("") {
49-
// dismiss()
50-
// }
51-
// .keyboardShortcut(.escape, modifiers: [])
52-
// .hidden()
53-
// }
54-
.onExitCommand(perform: {
55-
dismiss()
56-
})
47+
.background {
48+
Button("") {
49+
dismiss()
50+
}
51+
.keyboardShortcut(.escape, modifiers: [])
52+
.hidden()
53+
}
5754
.task {
5855
if let window = NSApp.findWindow(.about) {
5956
window.styleMask = [.closable, .fullSizeContentView, .titled, .nonactivatingPanel]

CodeEdit/Features/Editor/Models/Editor.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,16 @@ final class Editor: ObservableObject, Identifiable {
144144
/// - file: the file to open.
145145
/// - asTemporary: indicates whether the tab should be opened as a temporary tab or a permanent tab.
146146
func openTab(file: CEWorkspaceFile, asTemporary: Bool) {
147-
print("Attempting to open file: \(file.url)")
148147
let item = EditorInstance(file: file)
149148
// Item is already opened in a tab.
150149
guard !tabs.contains(item) || !asTemporary else {
151150
selectedTab = item
152151
history.prepend(item)
153-
print("File already opened!")
154152
return
155153
}
156154

157155
switch (temporaryTab, asTemporary) {
158156
case (.some(let tab), true):
159-
print("Temporary tab 1")
160157
if let index = tabs.firstIndex(of: tab) {
161158
history.removeFirst(historyOffset)
162159
history.prepend(item)
@@ -168,16 +165,13 @@ final class Editor: ObservableObject, Identifiable {
168165
}
169166

170167
case (.some(let tab), false) where tab == item:
171-
print("2")
172168
temporaryTab = nil
173169

174170
case (.none, true):
175-
print("3")
176171
openTab(file: item.file)
177172
temporaryTab = item
178173

179174
case (.none, false):
180-
print("4")
181175
openTab(file: item.file)
182176

183177
default:
@@ -192,7 +186,6 @@ final class Editor: ObservableObject, Identifiable {
192186
/// - fromHistory: Indicates whether the tab has been opened from going back in history.
193187
func openTab(file: CEWorkspaceFile, at index: Int? = nil, fromHistory: Bool = false) {
194188
let item = Tab(file: file)
195-
print("Tabs before update: \(tabs)")
196189
if let index {
197190
tabs.insert(item, at: index)
198191
} else {
@@ -203,9 +196,6 @@ final class Editor: ObservableObject, Identifiable {
203196
}
204197
}
205198

206-
print("Updated tabs: \(tabs)")
207-
print("New item: \(item.file.url)")
208-
209199
selectedTab = item
210200
if !fromHistory {
211201
history.removeFirst(historyOffset)
@@ -215,14 +205,12 @@ final class Editor: ObservableObject, Identifiable {
215205
do {
216206
try openFile(item: item)
217207
} catch {
218-
print("openFile error")
219208
print(error)
220209
}
221210
}
222211

223212
private func openFile(item: Tab) throws {
224213
guard item.file.fileDocument == nil else {
225-
print("File document is nil, returning!")
226214
return
227215
}
228216

@@ -235,7 +223,6 @@ final class Editor: ObservableObject, Identifiable {
235223
)
236224
item.file.fileDocument = codeFile
237225
CodeEditDocumentController.shared.addDocument(codeFile)
238-
print("Successfully opened file")
239226
}
240227

241228
func goBackInHistory() {

CodeEdit/Features/LSP/LanguageClient+ColorPresentation.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import Foundation
99
import LanguageServerProtocol
1010

1111
extension LanguageServer {
12-
func requestColorPresentation(document documentURI: String, _ color: Color, _ range: LSPRange) async -> ColorPresentationResponse {
12+
func requestColorPresentation(
13+
document documentURI: String,
14+
_ color: Color,
15+
_ range: LSPRange
16+
) async -> ColorPresentationResponse {
1317
let params = ColorPresentationParams(
1418
workDoneToken: nil,
1519
partialResultToken: nil,

CodeEdit/Features/LSP/LanguageClient+Completion.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ extension LanguageServer {
1414
if let cachedResponse: CompletionResponse = lspCache.get(key: cacheKey) {
1515
return cachedResponse
1616
}
17-
let completionParams = CompletionParams(uri: documentURI, position: position, triggerKind: .invoked, triggerCharacter: nil)
17+
let completionParams = CompletionParams(
18+
uri: documentURI,
19+
position: position,
20+
triggerKind: .invoked,
21+
triggerCharacter: nil
22+
)
1823
let response = try await lspInstance.completion(completionParams)
19-
24+
2025
lspCache.set(key: cacheKey, value: response)
2126
return response
2227
}

CodeEdit/Features/LSP/LanguageClient+Declaration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extension LanguageServer {
1919
} catch {
2020
print("requestGoToDeclaration Error \(error)")
2121
}
22-
22+
2323
return nil
2424
}
2525
}

CodeEdit/Features/LSP/LanguageClient+DocumentColor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Foundation
99
import LanguageServerProtocol
1010

1111
extension LanguageServer {
12-
/// The document color request is sent from the client to the server to list all color references found in a given text document. Along with the range, a color value in RGB is returned.
12+
/// The document color request is sent from the client to the server to list all color
13+
/// references found in a given text document. Along with the range, a color value in RGB is returned.
1314
/// Clients can use the result to decorate color references in an editor. For example:
1415
/// 1. Color boxes showing the actual color next to the reference
1516
/// 2. Show a color picker when a color reference is edited

CodeEdit/Features/LSP/LanguageClient+DocumentHighlight.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ import Foundation
99
import LanguageServerProtocol
1010

1111
extension LanguageServer {
12-
/// The document highlight request is sent from the client to the server to resolve document highlights for a given text document position.
13-
/// For programming languages this usually highlights all references to the symbol scoped to this file.
14-
func requestDocumentHighlight(document documentURI: String, _ position: Position) async -> DocumentHighlightResponse {
12+
/// The document highlight request is sent from the client to the server to resolve document
13+
/// highlights for a given text document position. For programming languages this usually
14+
/// highlights all references to the symbol scoped to this file.
15+
func requestDocumentHighlight(
16+
document documentURI: String,
17+
_ position: Position
18+
) async -> DocumentHighlightResponse {
1519
do {
1620
let params = DocumentHighlightParams(
1721
textDocument: TextDocumentIdentifier(uri: documentURI),

CodeEdit/Features/LSP/LanguageClient+DocumentLink.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extension LanguageServer {
1818
}
1919
return []
2020
}
21-
21+
2222
func requestDocumentLinkResolve(_ documentLink: DocumentLink) async -> DocumentLink? {
2323
do {
2424
return try await lspInstance.documentLinkResolve(documentLink)

CodeEdit/Features/LSP/LanguageClient+DocumentSymbol.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ import Foundation
99
import LanguageServerProtocol
1010

1111
extension LanguageServer {
12-
func requestDocumentSymbols(for languageId: LanguageIdentifier, document documentURI: String) async throws -> DocumentSymbolResponse {
12+
func requestDocumentSymbols(
13+
for languageId: LanguageIdentifier,
14+
document documentURI: String
15+
) async throws -> DocumentSymbolResponse {
1316
// let cacheKey = CacheKey(uri: documentURI, requestType: "documentSymbols")
1417
// if let cachedResponse: DocumentSymbolResponse = lspCache.get(key: cacheKey) {
1518
// return cachedResponse
1619
// }
17-
20+
1821
let textDocumentIdentifier = TextDocumentIdentifier(uri: documentURI)
1922
let documentSymbolParams = DocumentSymbolParams(textDocument: textDocumentIdentifier)
2023
let response = try await lspInstance.documentSymbol(documentSymbolParams)

0 commit comments

Comments
 (0)