Commit Graph

24 Commits

Author SHA1 Message Date
Alex Hoppen
1d7c27bc4b Adopt MemberImportVisibility 2024-11-05 21:04:01 -08:00
Alex Hoppen
8c34a76f59 Rename LSPLogging to SKLogging 2024-07-25 09:11:13 -07:00
Alex Hoppen
2877675bd5 Adopt package access level
Change a l public declarations to the `package` access level, accept for:
- The `LanguageServerProtocol` module
- The `BuildServerProtocol` module
- `InProcessClient.InProcessSourceKitLSPClient`
- `LanguageServerProtocolJSONRPC` (I would like to create a more ergonomic API for this like `InProcessSourceKitLSPClient` in the future, but for now, we’ll leave it public)

Unfortunately, our pattern of marking functions as `@_spi(Testing) public` no longer works with the `package` access level because declarations at the `package` access level cannot be marked as SPI. I have decided to just mark these functions as `package`. Alternatives would be:
- Add an underscore to these functions, like we did for functions exposed for testing before the introduction of `SPI`
- Use `@testable` import in the test targets and mark the methods as `internal`

Resolves #1315
rdar://128295618
2024-07-19 09:54:30 -07:00
Paul LeMarquand
c79f7dc9a7 Fix lint error 2024-06-03 15:35:45 -04:00
Paul LeMarquand
7734133cd1 Filter backticks in TestItem IDs
Backticks in TestItem IDs should be sanitized. Use the new
TokenSyntax.identifier when building up the TestItem IDs.
2024-06-03 11:40:42 -04:00
Kim de Vos
c5699fb4dd Fix deprecated ByteSourceRange 2024-05-10 10:50:57 +02:00
Paul LeMarquand
baa3f616c9 Handle XCTest extensions 2024-05-08 23:01:41 -04:00
Paul LeMarquand
e740bb3394 Dont expose isExtension on TestItem 2024-05-08 14:30:16 -04:00
Paul LeMarquand
adfae1a77f Prioritize tests defined in type definition over those in extensions
Sort the list of test items prioritizing those defined in the
originating type definition over those in extensions.
2024-05-07 13:55:55 -04:00
Paul LeMarquand
7b315680c9 Merge tests defined in extensions
Merge the XCTests and swift-testing tests defined in extensions into
their parent TestItems.

This is done as another pass after the TestScanner visitors have walked
the tree.

Fixes #1218
2024-05-07 13:39:25 -04:00
Paul LeMarquand
ccabf7adc6 Use .text over .trimmed 2024-04-30 14:29:01 -04:00
Paul LeMarquand
f89cf51011 Trim parameter names in SwiftTestingScanner
Test specified with anonymous arguments would produce an id with extra
whitespace, i.e: `funcWithArgument(_ x: Int)` would produce a TestItem
id of `funcWithArgument(_ :)`

This patch trims this extra whitespace to produce IDs that are
consistent with Swift's function ids, i.e: `funcWithArgument(_:)`
2024-04-30 14:05:10 -04:00
Paul LeMarquand
eb106c054a Lint fix 2024-04-24 16:49:40 -04:00
Paul LeMarquand
6f850ab084 Update tag tests 2024-04-24 14:25:55 -04:00
Paul LeMarquand
e26461eb3a More robust fully qualified name resolution
Add a `components` property to MemberAccessExprSyntax that provides all
the base names and the member's name as an array. When resolving
swift-testing Tags check if they start with Tag or Testing.Tag and drop
that from the name.
2024-04-24 14:20:44 -04:00
Paul LeMarquand
3bca8da4fe Remove leading dot on string tag representation 2024-04-24 14:20:38 -04:00
Paul LeMarquand
46286262a1 Simplify getting MemberAccessExprSyntax.components 2024-04-24 14:20:34 -04:00
Paul LeMarquand
f77f22bd5a All statics on Tag have a leading . 2024-04-24 14:20:31 -04:00
Paul LeMarquand
bff4a1efb2 Support statically defined tags
To remove namespacing ambiguity, support statically defined tags only.
2024-04-24 14:20:27 -04:00
Paul LeMarquand
35fe4aa378 More robust fully qualified name resolution
Add a `components` property to MemberAccessExprSyntax that provides all
the base names and the member's name as an array. When resolving
swift-testing Tags check if they start with Tag or Testing.Tag and drop
that from the name.
2024-04-24 14:20:16 -04:00
Paul LeMarquand
def5285102 Account for nested structs on Tag declarations
When a tag is declared within a nested type on Tag include the types
name in the tags string representation.
2024-04-24 14:20:12 -04:00
Paul LeMarquand
76c0860d15 Support member access in tags
Currently tags are only recognized when the tag is specified by string
literal, i.e: @Tag("foo").

Support Tags added via the staticMember Tag.Kind.
2024-04-24 14:20:06 -04:00
Alex Hoppen
a799da39aa Implement a syntactic workspace-wide test index
This workspace-wide syntactic test index is used for two purposes:
- It is used for XCTests instead of the semantic index for files that have on-disk or in-memory modifications to files
- It is uses for swift-testing tests, which are only discovered syntactically.

rdar://119191037
2024-04-23 09:25:31 -07:00
Alex Hoppen
1770204e5d 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.
2024-04-15 21:50:16 -07:00