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

Feature: List syntax errors for a file #1488

Closed
davidhalter opened this issue Jan 31, 2020 · 1 comment
Closed

Feature: List syntax errors for a file #1488

davidhalter opened this issue Jan 31, 2020 · 1 comment
Labels

Comments

@davidhalter
Copy link
Owner

This should be easily possible using parso. Just rewrap the errors from there.

API would look probably like this:

Script(...).get_syntax_errors() -> List[SyntaxError]

class SyntaxError:
    line: int
    column: int

Is somebody interested in more than this API? Would be happy to have some feedback here.

@davidhalter
Copy link
Owner Author

On the project branch, will be released in 0.17.0.

Please let me know if this works for you. I'm happy to change certain things. I'm not sure myself if sometimes the error is shown too late (e.g. when parentheses are not closing the next token is marked as a syntax error). It is obviously debatable where the errors are shown/marked. Please let me know what you think and I might change it.

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

No branches or pull requests

1 participant