Skip to content

Commit 1770204

Browse files
committed
Implement test discovery for swift-testing tests for the textDocument/tests request
This allows us to return swift-testing tests within a single document. It does not look for swift-testing tests workspace-wide (the `workspace/tests` request), which will be a follow-up PR.
1 parent 5a5b501 commit 1770204

File tree

5 files changed

+1092
-14
lines changed

5 files changed

+1092
-14
lines changed

Sources/LanguageServerProtocol/SupportTypes/TestItem.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public struct TestItem: ResponseType, Equatable {
3939
/// When `nil` the `label` is used.
4040
public let sortText: String?
4141

42+
/// Whether the test is disabled.
43+
public let disabled: Bool
44+
45+
/// The type of test, eg. the testing framework that was used to declare the test.
46+
public let style: String
47+
4248
/// The location of the test item in the source code.
4349
public let location: Location
4450

@@ -55,6 +61,8 @@ public struct TestItem: ResponseType, Equatable {
5561
label: String,
5662
description: String? = nil,
5763
sortText: String? = nil,
64+
disabled: Bool,
65+
style: String,
5866
location: Location,
5967
children: [TestItem],
6068
tags: [TestTag]
@@ -63,6 +71,8 @@ public struct TestItem: ResponseType, Equatable {
6371
self.label = label
6472
self.description = description
6573
self.sortText = sortText
74+
self.disabled = disabled
75+
self.style = style
6676
self.location = location
6777
self.children = children
6878
self.tags = tags

Sources/SourceKitLSP/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ target_sources(SourceKitLSP PRIVATE
3838
Swift/SourceKitD+ResponseError.swift
3939
Swift/SwiftCommand.swift
4040
Swift/SwiftLanguageService.swift
41+
Swift/SwiftTestingScanner.swift
4142
Swift/SymbolInfo.swift
4243
Swift/SyntaxHighlightingToken.swift
4344
Swift/SyntaxHighlightingTokens.swift

0 commit comments

Comments
 (0)