Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Line Numbering for Test Query Syntax Errors #315

Open
3 tasks done
bgribaudo opened this issue Mar 19, 2024 · 2 comments
Open
3 tasks done

Incorrect Line Numbering for Test Query Syntax Errors #315

bgribaudo opened this issue Mar 19, 2024 · 2 comments
Assignees
Labels
sdk tools Issue is related to the SDK Tools external nuget packages

Comments

@bgribaudo
Copy link
Contributor

Preflight Checklist

Power Query SDK

0.3.1

Regression From

No response

Platform

All

Architecture

x64

OS Version

No response

VSCode version

No response

PQSdkTool Path

No response

Bug Description

When a '.test.pq' file contains a syntax error, the error is reported (good) but the line number reported for it does not necessarily correspond to the location of the error in the '.test.pq' file.

Steps to Reproduce

  1. Create a new PQ SDK project.
  2. Set the '.test.pq' file's contents to:
    [a
    =
    3 +]
    
  3. Evaluate the '.test.pq' file.

Notice that the error is reported as occurring on line 4, when the problem is actually on line 3.

Actual Experience

Evaluation dies with:

Token Literal expected. Start position: (4, 4). End position (4, 5).

Expected Experience

Error's start and end position should reflect line 3, not line 4.

Additional Context

Related: #286

@bgribaudo
Copy link
Contributor Author

Is this stemming from the '.test.pq' file being converted to a section document before evaluation (e.g. because that adds a line of M code into the mix, causing the reported line number to be one off from the original source file)?

@mattmasson
Copy link
Member

Is this stemming from the '.test.pq' file being converted to a section document before evaluation (e.g. because that adds a line of M code into the mix, causing the reported line number to be one off from the original source file)?

Probably. I remember taking this into account in the initial implementation, but it looks like it might have been broken in subsequent refactoring.

@mattmasson mattmasson added the sdk tools Issue is related to the SDK Tools external nuget packages label Mar 19, 2024
@mattmasson mattmasson self-assigned this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk tools Issue is related to the SDK Tools external nuget packages
Projects
None yet
Development

No branches or pull requests

2 participants