Skip to content

Support member access in tags #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 29, 2024

Conversation

plemarquand
Copy link
Contributor

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, i.e: @Tag(.blue).

@plemarquand plemarquand requested a review from grynspan April 19, 2024 21:21
@plemarquand plemarquand requested a review from ahoppen April 20, 2024 18:45
@plemarquand plemarquand requested a review from grynspan April 22, 2024 19:23
@plemarquand plemarquand requested a review from grynspan April 22, 2024 20:09
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thank you! One minor comment and the other question is whether we want to include the leading dot in the tag name. My initial thought would have been not to but I think this also highly depends on how it ends up being displayed in VS Code, so I’ll ultimately leave it up to you.

@plemarquand
Copy link
Contributor Author

Talking with @grynspan we basically need to have the leading . to disambiguate tags in the static namespace from the ones defined in the string namespace. While we don't support string tags here for now we'll still need to be able to tell them apart.

In VSCode we can just drop the leading . for UX niceness, since its just used for filtering down the list of tests in the UI and then we send the filtered list over to swift-testing to run.

@plemarquand
Copy link
Contributor Author

After a chat with both @grynspan and @ahoppen I've removed the leading "." from the member accessed tags

@grynspan
Copy link

Would VSCode present these tags with a leading @, then?

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍🏽

@plemarquand plemarquand force-pushed the tag-member-access-syntax branch from 69f13f4 to ec5c614 Compare April 24, 2024 18:05
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.
When a tag is declared within a nested type on Tag include the types
name in the tags string representation.
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.
One that tests string tags, and the other that tests static tags.
To remove namespacing ambiguity, support statically defined tags only.
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.
@plemarquand plemarquand reopened this Apr 24, 2024
@plemarquand
Copy link
Contributor Author

plemarquand commented Apr 24, 2024

@grynspan VSCode automatically files tags under the top level test item so filtering by a tag called myTag you enter @MyTarget:myTag in the filter bar.

There are other automatic top level tags in VSCode such as @disabled and @failed

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member

ahoppen commented Apr 24, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member

ahoppen commented Apr 25, 2024

Looks like there’s another formatting issue

/Users/ec2-user/jenkins/workspace/swift-sourcekit-lsp-PR-macOS/branch-main/sourcekit-lsp/Tests/SourceKitLSPTests/DocumentTestDiscoveryTests.swift:686:35: warning: [TrailingComma] add trailing comma to the last element in multiline collection literal

I usually run the formatter using the Run swift-format Run Task in VS Code.

@plemarquand
Copy link
Contributor Author

@swift-ci Please test

@plemarquand
Copy link
Contributor Author

@swift-ci Please test Windows

1 similar comment
@plemarquand
Copy link
Contributor Author

@swift-ci Please test Windows

@plemarquand plemarquand merged commit 8f8e50e into swiftlang:main Apr 29, 2024
3 checks passed
@plemarquand plemarquand deleted the tag-member-access-syntax branch April 29, 2024 16:10
@plemarquand plemarquand restored the tag-member-access-syntax branch April 29, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants