Skip to content
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

Detecting doc fails on Swift 3.0 #269

Open
norio-nomura opened this issue Oct 13, 2016 · 3 comments
Open

Detecting doc fails on Swift 3.0 #269

norio-nomura opened this issue Oct 13, 2016 · 3 comments
Labels

Comments

@norio-nomura
Copy link
Collaborator

This is caused by difference of response from SourceKit between Swift 2.3 and Swift 3.0.
Swift 3.0 does not return "key.attribute" : "source.decl.attribute.__raw_doc_comment".

Swift 2.3:

$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 sourcekitten structure --text "
/// docs
public func a() {}
"
{
  "key.substructure" : [
    {
      "key.kind" : "source.lang.swift.decl.function.free",
      "key.offset" : 17,
      "key.attributes" : [
        {
          "key.attribute" : "source.decl.attribute.__raw_doc_comment"
        }
      ],
      "key.nameoffset" : 22,
      "key.namelength" : 3,
      "key.bodyoffset" : 27,
      "key.bodylength" : 0,
      "key.accessibility" : "source.lang.swift.accessibility.public",
      "key.length" : 11,
      "key.name" : "a()"
    }
  ],
  "key.offset" : 0,
  "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
  "key.length" : 29
}

Swift 3.0:

$ TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault sourcekitten structure --text "
/// docs
public func a() {}
"
{
  "key.substructure" : [
    {
      "key.kind" : "source.lang.swift.decl.function.free",
      "key.offset" : 17,
      "key.nameoffset" : 22,
      "key.namelength" : 3,
      "key.bodyoffset" : 27,
      "key.bodylength" : 0,
      "key.accessibility" : "source.lang.swift.accessibility.public",
      "key.length" : 11,
      "key.name" : "a()"
    }
  ],
  "key.offset" : 0,
  "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
  "key.length" : 29
}

Affected issue: realm/SwiftLint#728

@jpsim
Copy link
Owner

jpsim commented Oct 13, 2016

Oh that sucks. I wonder why that was removed 😞

@norio-nomura
Copy link
Collaborator Author

Yeah, then this is blocking realm/SwiftLint#832 by failing tests.

@norio-nomura
Copy link
Collaborator Author

https://bugs.swift.org/browse/SR-2487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants