jvolkman / intellij-protobuf-editor

Protocol Buffers for IntelliJ-based IDEs
Apache License 2.0
122 stars 15 forks source link

error msg "Expected ':' after non-message field name" Proto check #70

Closed labulakalia closed 2 years ago

labulakalia commented 2 years ago
    enum TimeType {
        UNSPECIFIED   = 0;
        CREATE_TIME   = 1;
        PURCHASE_TIME = 2;
    }
    TimeType time_type = 1 [ (validate.rules).enum = {not_in : [ 0 ]} ];

not_in after will display this error 截屏2021-11-30 下午4 35 08

labulakalia commented 2 years ago

https://github.com/jvolkman/intellij-protobuf-editor/blob/6e1f946ef24b19b97a777c7eb0f07d67dcbefb09/core/src/main/java/idea/plugin/protoeditor/lang/annotation/PbTextAnnotator.java#L209 but I do not know how to use java

jvolkman commented 2 years ago

It looks like there's a bug here if there is whitespace between the field name and the colon. Remove that space and the error will go away.

This repo is not the authoritative source for this plugin anymore; jetbrains took it over: https://github.com/JetBrains/intellij-plugins/tree/master/protobuf/

That said, I'll try to find some time to send them a PR. It's an easy fix.

labulakalia commented 2 years ago

@jvolkman thanks