microsoft / microsoft/vscode-powerquery

[BUG]: Improper handling of diagnostics causing unexpected behavior in formatting and autocomplete APIs

Open
#243 1 comment 0 reactions 1 assignee View on GitHub

@JordanBoltonMN is already working on this.

Since May 8, 2025.

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

Description

Expected behavior
An incorrect PQ should highlight diagnostics

Actual behavior
Diagnostics not highlighted as expected even for incorrect PQ which results in no formatting and incorrect suggestions creating unlikely user experience along with hampered API results for AutoComplete and Code Formatting

To Reproduce

  • The Power Query script that triggers the issue:
  1. The below code has Lex Error at second last line due to missing brackets thus breaking the overall syntax
let
	Source = Sql.Database(".", "SimpleMovies", [Query="SELECT [dbo].[Persons].* #(tab)#(tab)FROM [dbo].[Persons]"]),
	#"Renamed Columns" = Table.RenameColumns(Source, {{"Id", "Id"}, {"Height", "Height"}, {"BirthDate", "BirthDate"}, {"Nationality", "Nationality"}}),
	#"Changed Type" = Table.RenameColumns(#"Renamed Columns", {{"Id", Int64.Type}, {"FullName", type text}, {"BirthLocation", type text}, {"Country", type text}, {"ImageUrl)
in
  • Any non-default settings used in the API call(s) which trigger the issue:
  1. None

Additional context
Upon further investigation, the API internally seems to identify that there is a Lex Error but does not handle it in the 'validate' API.

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.