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

[SR-10074] Missing token classifications #421

Closed
krzyzanowskim opened this issue Mar 10, 2019 · 3 comments
Closed

[SR-10074] Missing token classifications #421

krzyzanowskim opened this issue Mar 10, 2019 · 3 comments
Labels
bug

Comments

@krzyzanowskim
Copy link

@krzyzanowskim krzyzanowskim commented Mar 10, 2019

Previous ID SR-10074
Radar None
Original Reporter @krzyzanowskim
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s SwiftSyntax
Labels Bug
Assignee None
Priority Medium

md5: fbabfbd422b18a4cb610bf491fdb56a8

Issue Description:

Looks like depends on how the classification is checked, the result may be different. Let's consider this sample:

  public func testClassification1() {
    let source = """
public final class Foo {}
"""
    let tree = try! SyntaxParser.parse(source: source)
    for token in tree.tokens {
        for classification in token.classifications {
            print("\(token.text) - \(classification.kind)")
        }
    }
  }

output:

public - keyword
class - keyword

Missing:

final - attribute

Now let's try this sample:

    public func testClassification2() {
        let source = """
public final class Foo {}
"""
        let tree = try! SyntaxParser.parse(source: source)
        for classification in tree.classifications {
            print("\(classification.kind)")
        }
    }

output:

keyword
attribute
keyword
@akyrtzi
Copy link
Member

@akyrtzi akyrtzi commented Mar 10, 2019

Thanks for the test case!

@akyrtzi
Copy link
Member

@akyrtzi akyrtzi commented Mar 11, 2019

@krzyzanowskim
Copy link
Author

@krzyzanowskim krzyzanowskim commented Mar 11, 2019

thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants