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

Report annotation syntax error #1384

Merged
merged 4 commits into from
Dec 5, 2024
Merged

Conversation

soutaro
Copy link
Owner

@soutaro soutaro commented Dec 5, 2024

Syntax errors in annotation are reported as SyntaxError in hint level and often overlooked. However, changing the SyntaxError diagnostic level doesn't make much sense, because the Ruby syntax error are usually uncovered by executing the program.

This PR introduces a new diagnostic -- AnnotationSytaxError, which is dedicated to the syntax errors in annotations. We can assign more verbose error level to the error.

@soutaro soutaro added this to the Steep 1.9 milestone Dec 5, 2024
@soutaro soutaro enabled auto-merge December 5, 2024 08:07
@soutaro soutaro force-pushed the report-annotation-syntax-error branch from 2f861a3 to b5aef80 Compare December 5, 2024 08:34
@soutaro soutaro merged commit 07ce1c0 into master Dec 5, 2024
19 checks passed
@soutaro soutaro deleted the report-annotation-syntax-error branch December 5, 2024 08:39
@soutaro soutaro added the Released The PR is already included in a published release label Dec 6, 2024
ydah added a commit to ydah/lrama that referenced this pull request Dec 9, 2024
The following changes caused the error.
- soutaro/steep#1384

```
lib/lrama/state/reduce.rb:30:36: [error] Type annotation has a syntax error: Failed to parse a type in annotation
│ Diagnostic ID: Ruby::AnnotationSyntaxError
│
└           # @type ivar @look_ahead: Array<Grammar::Symbol>
                                      ~~~~~~~~~~~~~~~~~~~~~~
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released The PR is already included in a published release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant