SourceKitten icon indicating copy to clipboard operation
SourceKitten copied to clipboard

Failure to parse macro definition

Open Craz1k0ek opened this issue 1 year ago • 1 comments

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

Craz1k0ek avatar Jul 02 '24 09:07 Craz1k0ek

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

johnfairh avatar Jul 03 '24 10:07 johnfairh