Skip to content

Empty or Comment Only File Dies with Unexpected Error #314

@bgribaudo

Description

@bgribaudo

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

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

  1. Create a new PQ SDK project.
  2. Either empty the '.query.pq' file, or set it to contain only a single-line comment (e.g. //hi).
  3. Evaluate the .query.pq file.

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: #244

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