Skip to content

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

@aayushbarmecha

Description

@aayushbarmecha

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.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions