Skip to content

Failure to parse macro definition #817

Open

Description

@Craz1k0ek

I ran into an issue attempting to parse a macro definition. I've got a macro definition file as follows:

@freestanding(expression)
public macro obfuscate(_ value: String) -> String = #externalMacro(module: "ObfuscatedStringMacros", type: "ObfuscationMacro")

Running sourcekitten structure --file ObfuscatedString.swift outputs the following JSON:

{
  "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
  "key.length" : 153,
  "key.offset" : 0,
  "key.substructure" : [
    {
      "key.kind" : "source.lang.swift.decl.var.parameter",
      "key.length" : 15,
      "key.name" : "value",
      "key.offset" : 49,
      "key.typename" : "String"
    }
  ]
}

I would like SourceKitten to correctly identify the elements of the macro definition

Activity

  1. johnfairh commented on Jul 3, 2024

    @johnfairh
    Collaborator

    Unfortunately this is a Swift issue, swiftlang/swift#66666.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions