microsoft / microsoft/vscode-powerquery-sdk
Empty or Comment Only File Dies with Unexpected Error
@mattmasson is already working on this.
Since Mar 19, 2024.
- Dominant language
- TypeScript
- Stars
- 92
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Preflight Checklist
- I have installed the latest version of Power Query SDK.
- I have checked existing resources, including the common issues and the release notes.
- I have searched for similar issues.
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
If a query test file is evaluated that is either blank or only contains a comment, an unexpected error is output.
The error indicates that a "token literal" is expected (even though non-literal values are also allowed) and indicates that the error occurs on line 3, even though the file does not contain 3 lines.
Steps to Reproduce
- Create a new PQ SDK project.
- Either empty the '.query.pq' file, or set it to contain only a single-line comment (e.g.
//hi). - Evaluate the
.query.pqfile.
Actual Experience
The following error is returned:
Token Literal expected. Start position: (3, 1). End position (3, 2).
Expected Experience
At minimum, correct line numbering (e.g. reporting the error as occurring on line 1, not the non-existent line 3).
Ideally, a message saying effectively that some code is expected in the file (maybe that the file must contain either an expression or a section document).
Additional Context
Related: https://github.com/microsoft/vscode-powerquery-sdk/issues/244
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.