Skip to content

Syntax Error - Indicate Location #286

@bgribaudo

Description

@bgribaudo

Preflight Checklist

Problem

When a .pq file has a syntax error, the error that is displayed may not identify which file in the project has the problem.

Example

Notice how below reports a syntax error, but not where it is to be found:

[5:58:24 PM]	[Info]	[Task found] c:\Users\ben\.vscode\extensions\powerquery.vscode-powerquery-sdk-0.2.3-win32-x64\.nuget\Microsoft.PowerQuery.SdkTools.2.114.4\tools\PQTest.exe run-test
				--extension "Some.mez"
				--queryFile "Some.query.pq"
				--prettyPrint
[5:58:26 PM]	[Error]	[Task exited abnormally] pqtest run-test pid(23484) exit(3762504530) stderr: 
Unhandled Exception: System.InvalidOperationException: Unable to parse the document
   at PQTest.Common.Utilities.Parse(String mashupDocument)
   at PQTest.Common.Utilities.GetDocumentKind(String code)
   at PQTest.Common.QueryFileAnalyzer.PerformAnalysis()
   at PQTest.Common.Commands.PrepareTests(Configuration configuration)
   at PQTest.Common.Commands.<>c__DisplayClass14_0.<RunTestBattery>b__0()
   at PQTest.Common.Commands.ConfigureMashupEnvironmentAndRun(Configuration configuration, Action action)
   at PQTest.Console.Program.RunTestBatteryCommand(CommandLineApplication app, CommandLineApplication command, Action`1 invoke)
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at PQTest.Console.Program.Main(String[] args)

Desired Solution

Indication of which file contains the syntax error and (ideally) the line and column number of its location.

Alternatives and Workarounds

No response

Additional Context

The above example error was from a syntax problem in the .query.pq file.

Metadata

Metadata

Assignees

Labels

sdk toolsIssue is related to the SDK Tools external nuget packages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions