Skip to content

Commit b4cf0da

Browse files
address review comments
1 parent 9446520 commit b4cf0da

File tree

1 file changed

+21
-62
lines changed

1 file changed

+21
-62
lines changed

Sources/SourceKitLSP/Documentation/DocumentationLanguageService.swift

Lines changed: 21 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import BuildSystemIntegration
14-
import Csourcekitd
15-
import Dispatch
1613
import Foundation
17-
import IndexStoreDB
18-
import SKLogging
19-
import SemanticIndex
20-
import SwiftExtensions
21-
import SwiftParser
22-
import SwiftParserDiagnostics
2314

2415
#if compiler(>=6)
2516
package import LanguageServerProtocol
@@ -109,16 +100,14 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
109100
}
110101

111102
package func completion(_ req: CompletionRequest) async throws -> CompletionList {
112-
.init(isIncomplete: false, items: [])
103+
CompletionList(isIncomplete: false, items: [])
113104
}
114105

115106
package func hover(_ req: HoverRequest) async throws -> HoverResponse? {
116-
.none
107+
nil
117108
}
118109

119-
package func symbolInfo(
120-
_ request: SymbolInfoRequest
121-
) async throws -> [SymbolDetails] {
110+
package func symbolInfo(_ request: SymbolInfoRequest) async throws -> [SymbolDetails] {
122111
[]
123112
}
124113

@@ -131,39 +120,27 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
131120
nil
132121
}
133122

134-
package func definition(
135-
_ request: DefinitionRequest
136-
) async throws -> LocationsOrLocationLinksResponse? {
123+
package func definition(_ request: DefinitionRequest) async throws -> LocationsOrLocationLinksResponse? {
137124
nil
138125
}
139126

140-
package func declaration(
141-
_ request: DeclarationRequest
142-
) async throws -> LocationsOrLocationLinksResponse? {
127+
package func declaration(_ request: DeclarationRequest) async throws -> LocationsOrLocationLinksResponse? {
143128
nil
144129
}
145130

146-
package func documentSymbolHighlight(
147-
_ req: DocumentHighlightRequest
148-
) async throws -> [DocumentHighlight]? {
131+
package func documentSymbolHighlight(_ req: DocumentHighlightRequest) async throws -> [DocumentHighlight]? {
149132
nil
150133
}
151134

152-
package func foldingRange(
153-
_ req: FoldingRangeRequest
154-
) async throws -> [FoldingRange]? {
135+
package func foldingRange(_ req: FoldingRangeRequest) async throws -> [FoldingRange]? {
155136
nil
156137
}
157138

158-
package func documentSymbol(
159-
_ req: DocumentSymbolRequest
160-
) async throws -> DocumentSymbolResponse? {
139+
package func documentSymbol(_ req: DocumentSymbolRequest) async throws -> DocumentSymbolResponse? {
161140
nil
162141
}
163142

164-
package func documentColor(
165-
_ req: DocumentColorRequest
166-
) async throws -> [ColorInformation] {
143+
package func documentColor(_ req: DocumentColorRequest) async throws -> [ColorInformation] {
167144
[]
168145
}
169146

@@ -185,37 +162,27 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
185162
nil
186163
}
187164

188-
package func colorPresentation(
189-
_ req: ColorPresentationRequest
190-
) async throws -> [ColorPresentation] {
165+
package func colorPresentation(_ req: ColorPresentationRequest) async throws -> [ColorPresentation] {
191166
[]
192167
}
193168

194-
package func codeAction(
195-
_ req: CodeActionRequest
196-
) async throws -> CodeActionRequestResponse? {
169+
package func codeAction(_ req: CodeActionRequest) async throws -> CodeActionRequestResponse? {
197170
nil
198171
}
199172

200-
package func inlayHint(
201-
_ req: InlayHintRequest
202-
) async throws -> [InlayHint] {
173+
package func inlayHint(_ req: InlayHintRequest) async throws -> [InlayHint] {
203174
[]
204175
}
205176

206177
package func codeLens(_ req: CodeLensRequest) async throws -> [CodeLens] {
207178
[]
208179
}
209180

210-
package func documentDiagnostic(
211-
_ req: DocumentDiagnosticsRequest
212-
) async throws -> DocumentDiagnosticReport {
213-
.full(.init(items: []))
181+
package func documentDiagnostic(_ req: DocumentDiagnosticsRequest) async throws -> DocumentDiagnosticReport {
182+
.full(RelatedFullDocumentDiagnosticReport(items: []))
214183
}
215184

216-
package func documentFormatting(
217-
_ req: DocumentFormattingRequest
218-
) async throws -> [TextEdit]? {
185+
package func documentFormatting(_ req: DocumentFormattingRequest) async throws -> [TextEdit]? {
219186
nil
220187
}
221188

@@ -229,10 +196,8 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
229196
return nil
230197
}
231198

232-
package func rename(
233-
_ request: RenameRequest
234-
) async throws -> (edits: WorkspaceEdit, usr: String?) {
235-
(edits: .init(), usr: nil)
199+
package func rename(_ request: RenameRequest) async throws -> (edits: WorkspaceEdit, usr: String?) {
200+
(edits: WorkspaceEdit(), usr: nil)
236201
}
237202

238203
package func editsToRename(
@@ -250,9 +215,7 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
250215
nil
251216
}
252217

253-
package func indexedRename(
254-
_ request: IndexedRenameRequest
255-
) async throws -> WorkspaceEdit? {
218+
package func indexedRename(_ request: IndexedRenameRequest) async throws -> WorkspaceEdit? {
256219
nil
257220
}
258221

@@ -264,16 +227,12 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
264227
[]
265228
}
266229

267-
package func executeCommand(
268-
_ req: ExecuteCommandRequest
269-
) async throws -> LSPAny? {
230+
package func executeCommand(_ req: ExecuteCommandRequest) async throws -> LSPAny? {
270231
nil
271232
}
272233

273-
package func getReferenceDocument(
274-
_ req: GetReferenceDocumentRequest
275-
) async throws -> GetReferenceDocumentResponse {
276-
.init(content: "")
234+
package func getReferenceDocument(_ req: GetReferenceDocumentRequest) async throws -> GetReferenceDocumentResponse {
235+
GetReferenceDocumentResponse(content: "")
277236
}
278237

279238
package func syntacticDocumentTests(

0 commit comments

Comments
 (0)