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

Improve error messages #3256

Open
liviubobocu opened this issue Feb 15, 2025 · 0 comments
Open

Improve error messages #3256

liviubobocu opened this issue Feb 15, 2025 · 0 comments

Comments

@liviubobocu
Copy link

Current error messages that come from parser are not very friendly to be used in editors.
An improvement that would help with the usage of jqlang in editors (like Monaco) would be to specify line and column properly for the syntax issue such that a tool could be used to highlight the syntax issue while typing. (In monaco editor, we don't have any means of getting line and number for a syntax error). Another improvement would be to format the message in a more human readable format.

Example for parsing an expression:

./jq ".map]"

jq: error: syntax error, unexpected INVALID_CHARACTER, expecting end of file (Unix shell quoting issues?) at , line 1:
.map]

Suggestion:

jq: syntax error at line 0, column 4: Found INVALID_CHARACTER where it was not expected. Expected end of file. This might be due to Unix shell quoting issues. at , line 1:
.map]

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

No branches or pull requests

1 participant