Skip to content

[Swift 6] SPI attributes missing from sourcekit cursorinfo #74547

Open
@johnfairh

Description

@johnfairh

Description

CursorInfo in Swift 6 has stopped reporting all attributes in declarations - in particular the @_spi attribute is missing. This has lost the information about what SPI group a declaration is in.

(This isn't about key.attributes which continues to correctly indicate whether any _spis are set.)

Reproduction

cursorinfo against:

@_spi(Hello)
public struct Barney {}

Expected behavior

Swift 5.10:

"key.fully_annotated_decl" : "<decl.struct>
    <syntaxtype.attribute.name>@_spi<\/syntaxtype.attribute.name>(Hello)
    <syntaxtype.keyword>public<\/syntaxtype.keyword>
    <syntaxtype.keyword>struct<\/syntaxtype.keyword>
    <decl.name>Barney<\/decl.name
><\/decl.struct>"

Swift 6:

"key.fully_annotated_decl" : "<decl.struct>
    <syntaxtype.keyword>public<\/syntaxtype.keyword>
    <syntaxtype.keyword>struct<\/syntaxtype.keyword>
    <decl.name>Barney<\/decl.name>
<\/decl.struct>"

Environment

Xcode 16.0 beta (16A5171c)

swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10)
Target: x86_64-apple-macosx14.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    SourceKitArea → source tooling: SourceKitbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions