microsoft / microsoft/vscode-powerquery

field access generalized identifiers highlight as seperate tokens

Open
#66 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

grammar
Dominant language
TypeScript
Stars
108
Forks
25
Avg merge
8d 22h
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the extension's syntax-highlighting grammar, especially the Expand grammar noted in the issue, and compare its scopes for the quoted and unquoted field-access forms in the Test Query. Check whether the behavior belongs in vscode-powerquery or microsoft/powerquery-parser. Done means generalized identifiers such as [Records in Range] no longer highlight words like “in” as standalone language keywords.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.