-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: add severity levels to build errors #1285 #1544
fix: add severity levels to build errors #1285 #1544
Conversation
@@ -132,6 +133,18 @@ func generateStruct(t reflect.Type, messages map[string]string) { | |||
messages[t.Name()] = w.String() | |||
} | |||
|
|||
// generateWellKnownNestedEnums generates the well-known nested enums for a given reflect.Type. | |||
// Reflection cannot discover type aliased enums, so they need to get generated manually. | |||
func generateWellKnownNestedEnums(t reflect.Type, w *strings.Builder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah awesome, I've been meaning to do something about enums for a while now.
This, and the "chicken and egg" problem of having the proto schema rely on the Go schema compiling and existing would be nice to solve in the general case. I think the permanent solution is to switch to static analysis. But this is great for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to not have tests, the .proto file successfully compiling is sufficient.
backend/schema/protobuf_test.go
Outdated
@@ -14,3 +14,7 @@ func TestProtoRoundtrip(t *testing.T) { | |||
assert.NoError(t, err) | |||
assert.Equal(t, Normalise(testSchema), Normalise(actual)) | |||
} | |||
|
|||
func TestErrorProtoGeneration(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if not used?
I think this needs to be plumbed through to the LSP too. |
No description provided.