Skip to content

fix: correctly report error position on unknown directive without values #3518

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

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

kasiaMarek
Copy link
Collaborator

This PR changes positions in unrecognised directives errors.
fixes: #3389

Previously

Errors used to be reported on values:

Unrecognized directive: wrong.directive with values: value
//> using wrong.directive value
                          ^^^^^

which resulted also in two errors for two values:

Unrecognized directive: wrong.directive with values: value1, value2
//> using wrong.directive value1 value2
                          ^^^^^^
Unrecognized directive: wrong.directive with values: value1, value2
//> using wrong.directive value1 value2
                                 ^^^^^^

and incorrect position for no values.

Now

We use directive position for error report:

Unrecognized directive: wrong.directive with values: value1, value2
//> using wrong.directive value1 value2
          ^^^^^^^^^^^^^^^

Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Gedochao Gedochao enabled auto-merge (squash) February 26, 2025 09:33
@Gedochao Gedochao merged commit 9d6e4e1 into VirtusLab:main Feb 26, 2025
72 of 77 checks passed
Mee-Tree pushed a commit to Mee-Tree/scala-cli that referenced this pull request Mar 21, 2025
…ues (VirtusLab#3518)

* fix: correctly report error position on unknown directive without values

* revert unneeded change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The unrecognized directive error for an unrecognized directive without values reports strings from the next line
2 participants