microsoft / microsoft/vscode-powerquery
[BUG]: Improper handling of diagnostics causing unexpected behavior in formatting and autocomplete APIs
@JordanBoltonMN is already working on this.
Since May 8, 2025.
- 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:
- 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:
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.