Closed belkadan closed 3 years ago
Taking another look at this, I think the trailing where
in the final case
was intentional, but should also apply to .period
as well (to cover nested type names). You're absolutely right about the incorrect capitalization check, though. Should be an easy fix. I'll get a PR started for this.
Edit: See #6
Colon seems like it needs the same check, because of dictionary literals. (Really, I would hope that anywhere :
indicates a type, it's already a typeIdentifier
node kind, but I'm not sure if libSyntax actually does this.)
https://github.com/NSHipster/SwiftSyntaxHighlighter/blob/dca53e3e9063cef8f4e591ee9d8ee0cb32a3b925/Sources/TokenizationSchemes/Xcode/Xcode.swift#L15-L33
In this code, the
where
clause only applies to the.leftSquareBracket
case, but not all (say) members are types. Beyond that, though, thecapitalized
property lowercases all further letters, meaning something like "UnsafePointer" wouldn't pass the test.