microsoft / microsoft/powerquery-language-services

[BUG] Function parameter names that also are PQ type names are incorrectly syntax highlighted

Open
#224 0 comments 0 reactions 1 assignee View on GitHub

@JordanBoltonMN is already working on this.

Since Mar 23, 2023.

bug
Dominant language
TypeScript
Stars
49
Forks
15
Avg merge
1h 26m
Merged PRs (30d)
2

Description

In M, it is valid to name function parameters after M types, as parameter names will not be interpreted as type names when defining a function’s signature. However, syntax highlighting does not seem to make this distinction.

Expected behavior
In a function signature, parameters that have the same names as M types should be syntax highlighted the same as parameters with other names.

Actual behavior
Parameters with the same names as M types are highlighted differently.

Notice below how the red-underlined parameter names (which are identical to M type names) receive different syntax highlighting than the green-underlined one.
image

To Reproduce
In VSCode, create a Power Query file containing the following content:

(table as table, function as function, a as number) as any => ...

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.