Skip to content

[6.0] [Completion] Update type attribute completions #74989

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 5 commits into from
Jul 6, 2024

Conversation

hamishknight
Copy link
Contributor

6.0 cherry-pick of #74890

  • Explanation: Updates type attribute completion to support @isolated(any), @noDerivative, @preconcurrency, @retroactive, @Sendable, and @unchecked
  • Scope: Affects code completion
  • Issue: rdar://130741006, rdar://130288443
  • Risk: Fairly low, should only affect code completion
  • Testing: Added tests to test suite
  • Reviewer: Alex Hoppen

These aren't currently claimed by anything other
than SILFunctions, and as such are invalid in
regular Swift code. Treat them as SIL type
attributes. Also while here, fix the SIL reference
attributes to be SIL attributes.
`TypeAttribute::isSilOnly` does the same thing.
Pick up all non-underscored simple type attributes
for code completion, and add support for
`@isolated(any)`.

rdar://130741006
rdar://130288443
Add a case for completing type attributes in
inheritance clause position, and limit the
completion of `@unchecked`, `@preconcurrency`, and
`@retroactive` to that case.
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jul 5, 2024
@hamishknight hamishknight requested a review from bnbarham July 5, 2024 15:09
@hamishknight hamishknight requested a review from a team as a code owner July 5, 2024 15:09
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@@ -83,6 +82,7 @@ SIMPLE_SIL_TYPE_ATTR(inout, Inout)
SIMPLE_SIL_TYPE_ATTR(inout_aliasable, InoutAliasable)
SIMPLE_SIL_TYPE_ATTR(in_guaranteed, InGuaranteed)
SIMPLE_SIL_TYPE_ATTR(in_constant, InConstant)
SIMPLE_SIL_TYPE_ATTR(noescape, NoEscape)
Copy link
Contributor

Choose a reason for hiding this comment

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

@rjmccall I don't suppose you remember why we didn't make noescape (and async) a SIMPLE_SIL_TYPE_ATTR in 41cdfb0? Mostly asking in terms of risk here - we could instead leave this change out of 6.0 and just add the missing completions in.

Copy link
Contributor

Choose a reason for hiding this comment

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

I intentionally didn't put any effort in that patch into recategorizing the existing attributes. I wanted it to be focused on the high-level representation change.

I don't know why they're not simple attributes in SIL. They certainly look like simple attributes.

Copy link
Contributor

Choose a reason for hiding this comment

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

All good, was just checking that there wasn't any underlying reason that we missed. Thanks!

@hamishknight hamishknight merged commit e14d3a3 into swiftlang:release/6.0 Jul 6, 2024
5 checks passed
@hamishknight hamishknight deleted the attr-etc-6.0 branch July 6, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants