Skip to content

Commit 183277a

Browse files
authored
Merge pull request #2278 from ahoppen/syntactic-tests-docc
Explicitly implement `syntacticTestItems` in `DocumentationLanguageService`
2 parents 56fa14a + ef66508 commit 183277a

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

Sources/DocumentationLanguageService/DocumentationLanguageService.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ package actor DocumentationLanguageService: LanguageService, Sendable {
8888
// The DocumentationLanguageService does not do anything with document events
8989
}
9090

91+
package static func syntacticTestItems(in uri: DocumentURI) async -> [AnnotatedTestItem] {
92+
return []
93+
}
94+
9195
package func changeDocument(
9296
_ notification: DidChangeTextDocumentNotification,
9397
preEditSnapshot: DocumentSnapshot,

Sources/SourceKitLSP/LanguageService.swift

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ package extension LanguageService {
342342

343343
static var experimentalCapabilities: [String: LSPAny] { [:] }
344344

345-
func clientInitialized(_ initialized: LanguageServerProtocol.InitializedNotification) async {}
345+
func clientInitialized(_ initialized: InitializedNotification) async {}
346346

347347
func openOnDiskDocument(snapshot: DocumentSnapshot, buildSettings: FileBuildSettings) async throws {
348-
throw ResponseError.unknown("\(#function) not implemented in \(Self.self)")
348+
throw ResponseError.unknown("\(#function) not implemented in \(Self.self) for \(snapshot.uri)")
349349
}
350350

351351
func closeOnDiskDocument(uri: DocumentURI) async throws {
352-
throw ResponseError.unknown("\(#function) not implemented in \(Self.self)")
352+
throw ResponseError.unknown("\(#function) not implemented in \(Self.self) for \(uri)")
353353
}
354354

355355
func willSaveDocument(_ notification: WillSaveTextDocumentNotification) async {}
@@ -386,15 +386,15 @@ package extension LanguageService {
386386
for snapshot: DocumentSnapshot,
387387
at position: Position
388388
) async throws -> (symbolGraph: String, usr: String, overrideDocComments: [String]) {
389-
throw ResponseError.internalError("\(#function) not implemented in \(Self.self)")
389+
throw ResponseError.internalError("\(#function) not implemented in \(Self.self) for \(snapshot.uri)")
390390
}
391391

392392
func symbolGraph(
393393
forOnDiskContentsAt location: SymbolLocation,
394394
in workspace: Workspace,
395395
manager: OnDiskDocumentManager
396396
) async throws -> String {
397-
throw ResponseError.internalError("\(#function) not implemented in \(Self.self)")
397+
throw ResponseError.internalError("\(#function) not implemented in \(Self.self) for \(location.path)")
398398
}
399399

400400
func openGeneratedInterface(
@@ -403,7 +403,7 @@ package extension LanguageService {
403403
groupName: String?,
404404
symbolUSR symbol: String?
405405
) async throws -> GeneratedInterfaceDetails? {
406-
throw ResponseError.internalError("Generated interface not implemented in \(Self.self)")
406+
throw ResponseError.internalError("Generated interface not implemented in \(Self.self) for \(document)")
407407
}
408408

409409
func definition(_ request: DefinitionRequest) async throws -> LocationsOrLocationLinksResponse? {
@@ -488,7 +488,7 @@ package extension LanguageService {
488488
oldName: CrossLanguageName,
489489
newName: CrossLanguageName
490490
) async throws -> [TextEdit] {
491-
throw ResponseError.internalError("\(#function) not implemented in \(Self.self)")
491+
throw ResponseError.internalError("\(#function) not implemented in \(Self.self) for \(snapshot.uri)")
492492
}
493493

494494
func prepareRename(
@@ -502,11 +502,11 @@ package extension LanguageService {
502502
}
503503

504504
func editsToRenameParametersInFunctionBody(
505-
snapshot: SourceKitLSP.DocumentSnapshot,
506-
renameLocation: SourceKitLSP.RenameLocation,
507-
newName: SourceKitLSP.CrossLanguageName
508-
) async -> [LanguageServerProtocol.TextEdit] {
509-
logger.error("\(#function) not implemented in \(Self.self)")
505+
snapshot: DocumentSnapshot,
506+
renameLocation: RenameLocation,
507+
newName: CrossLanguageName
508+
) async -> [TextEdit] {
509+
logger.error("\(#function) not implemented in \(Self.self) for \(snapshot.uri)")
510510
return []
511511
}
512512

@@ -519,19 +519,11 @@ package extension LanguageService {
519519
}
520520

521521
func syntacticDocumentTests(for uri: DocumentURI, in workspace: Workspace) async throws -> [AnnotatedTestItem]? {
522-
throw ResponseError.internalError("syntacticDocumentTests not implemented in \(Self.self)")
523-
}
524-
525-
static func syntacticTestItems(in uri: LanguageServerProtocol.DocumentURI) async -> [SourceKitLSP.AnnotatedTestItem] {
526-
logger.error("\(#function) not implemented in \(Self.self)")
527-
return []
522+
throw ResponseError.internalError("syntacticDocumentTests not implemented in \(Self.self) for \(uri)")
528523
}
529524

530-
func canonicalDeclarationPosition(
531-
of position: LanguageServerProtocol.Position,
532-
in uri: LanguageServerProtocol.DocumentURI
533-
) async -> LanguageServerProtocol.Position? {
534-
logger.error("\(#function) not implemented in \(Self.self)")
525+
func canonicalDeclarationPosition(of position: Position, in uri: DocumentURI) async -> Position? {
526+
logger.error("\(#function) not implemented in \(Self.self) for \(uri)")
535527
return nil
536528
}
537529

0 commit comments

Comments
 (0)