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

Missing errors for enum shapes without members #81

Closed
milesziemer opened this issue Dec 12, 2022 · 1 comment · Fixed by smithy-lang/smithy#1580
Closed

Missing errors for enum shapes without members #81

milesziemer opened this issue Dec 12, 2022 · 1 comment · Fixed by smithy-lang/smithy#1580

Comments

@milesziemer
Copy link
Contributor

Take the following model:

$version: "2"

namespace smithy.example

enum Foo {}

Building this model fails with something like:

ERROR: smithy.example#Foo (Model)
     = enum must have at least one entry

But the language server does not give any highlighting or underlying indicating that enums must have at least one entry.

@daddykotex
Copy link
Contributor

I found that the issue originates from smithy-model. This is because we're missing the location for the SyntheticEnumTrait that's created and where the validation happen. Because the location is not there, the language server can bind the validation error to a Diagnostic on a file.

Tested with a local publish:

Screen Shot 2023-01-12 at 10 49 38

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 a pull request may close this issue.

2 participants