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

Fix trait source locations #1146

Merged
merged 1 commit into from
Mar 22, 2022
Merged

Fix trait source locations #1146

merged 1 commit into from
Mar 22, 2022

Commits on Mar 22, 2022

  1. Fix trait source locations

    This fixes trait source locations from the IDL to start at the trait
    itself rather than at the start of the trait's node definition. This
    is particularly important for annotation traits where the source
    location previously pointed to the column *after* the trait, which
    doesn't necessarily even exist.
    
    The following shows where the source location used to point:
    
    ```
    @annotation
               ^
    
    @annotationWithParens()
                           ^
    
    @listTrait(["foo"])
                ^
    
    @structuredTrait({
                     ^
        "foo": "bar"
    })
    
    @structuredTraitWithoutBraces(
        foo: "bar"
        ^
    )
    
    @primitiveTrait(true)
                    ^
    ```
    
    And this shows where they point now:
    
    ```
    @annotation
    ^
    
    @annotationWithParens()
    ^
    
    @listTrait(["foo"])
    ^
    
    @structuredTrait({
    ^
        "foo": "bar"
    })
    
    @structuredTraitWithoutBraces(
    ^
        foo: "bar"
    )
    
    @primitiveTrait(true)
    ^
    ```
    JordonPhillips committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    9956a7c View commit details
    Browse the repository at this point in the history