Skip to content

Swift lang syntax to unite types #234

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

Merged
merged 3 commits into from
Aug 21, 2016

Conversation

esuvorov
Copy link
Contributor

@esuvorov esuvorov commented Aug 1, 2016

Unite swift lang syntax types with SwiftLangSyntax protocol
Make SwiftDocKey public

@jpsim
Copy link
Owner

jpsim commented Aug 2, 2016

@esuvorov thanks for the PR! Can you please explain the rationale behind these changes? I'm cautious when modifying the public API because it affects consumers of the library and restricts what kinds of changes can be made later.

@esuvorov
Copy link
Contributor Author

esuvorov commented Aug 2, 2016

@jpsim, hi!
I'm currently adding a couple ASTRule for SwiftLint which uses SourceKitten as dependency.

As i see SwiftLint framework use a lot of independent strings "key.everything" for AST parsing while in SourceKitten already exist SwiftDocKey. Of course i can add similar enum in local module, but as i think much better to use what we have instead of dublicate code.

Also in SwiftLint exist a couple methods which uses only for SyntaxKind, but they could be more usefully and flexible if we change SyntaxKind for SwiftLangSyntax abstraction.

So i made two main changes:

  • SwiftLangSyntax protocol for unite source.lang.swift.* family for unification of StatementKind, SwiftDeclarationKind, SyntaxKind. (I'm not sure about the name of SwiftLangSyntax)
  • and make SwiftDocKey public.

@jpsim
Copy link
Owner

jpsim commented Aug 21, 2016

Sorry for the long delay @esuvorov. Thanks for the PR, I'll accept this as a short term solution until SourceKitten can move away from untyped dictionaries towards typed declarations (#238).

@jpsim jpsim merged commit d34516e into jpsim:master Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants