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

field access generalized identifiers highlight as seperate tokens #66

Open
ninmonkey opened this issue Nov 26, 2020 · 3 comments
Open
Labels

Comments

@ninmonkey
Copy link
Contributor

Summary

This is minor: field access without quoted-identifiers highlight as separate tokens.
ex: The textmate scope of in in [Records in Range] is a language keyword

image

I wasn't sure whether this is at the extension level or microsoft/powerquery-parser I put it here because even though textmate's scope is a keyword -- the parser seems to format correctly. I tried using a strange generalized-identifier to see if I could break the formatting, but it did not.

record textmate scopes

Power BI's editor has the same behaviour

image

Test Query

let
    Source = ...,
    #"Total Records1" = Table.AddColumn(
        Source, "Count 1",
        each Table.RowCount( [#"Records in Range"] ),
        type number
    ),
    #"Total Records2" = Table.AddColumn(
        Source, "Count 2",
        each Table.RowCount( [Records in Range] ),
        type number
    )

in
    #"Total Records2"

I think this is the grammar involved (Expand)

.

image

@mattmasson
Copy link
Member

Yeah, this is an issue with our grammar file. In theory we could resolve it by enabling semantic highlighting via the powerquery-parser, but it should be pretty straightforward to resolve.

FWIW, we do have a separate github project for the language grammar (that has fallen out of date), but it does have some built in tests. I've been meaning to get it running again, but if anyone else wants to pick that up, please feel free :)

powerquery-language

/@JordanBoltonMN as FYI

@ninmonkey
Copy link
Contributor Author

@mattmasson Which project is that?

@JordanBoltonMN
Copy link
Contributor

@mattmasson Which project is that?

https://github.com/microsoft/powerquery-language

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

3 participants