diff --git a/src/workspace/docs/builtin/bool.md b/src/workspace/docs/builtin/bool.md new file mode 100644 index 0000000..7c0dde6 --- /dev/null +++ b/src/workspace/docs/builtin/bool.md @@ -0,0 +1,4 @@ +*bool* builtin type, A Boolean value: `true` or `false`. + +--- +Encoded as a single byte: `0x00` or `0xff` (all non-zero bytes decode to `true`) diff --git a/src/workspace/docs/builtin/bytes.md b/src/workspace/docs/builtin/bytes.md new file mode 100644 index 0000000..606041e --- /dev/null +++ b/src/workspace/docs/builtin/bytes.md @@ -0,0 +1,5 @@ +*bytes* builtin type, A blob of arbitrary bytes. + +--- +Stores at most 4GB of binary data. Encoded as base64 in JSON. + diff --git a/src/workspace/docs/builtin/default.md b/src/workspace/docs/builtin/default.md new file mode 100644 index 0000000..dd56b3f --- /dev/null +++ b/src/workspace/docs/builtin/default.md @@ -0,0 +1,7 @@ +*default* builtin type, A magic option that specifies the field's default value. + +--- + +Unlike every other option on a field, this does not have a corresponding field in +`google.protobuf.FieldOptions`; it is implemented by compiler magic. + diff --git a/src/workspace/docs/builtin/double.md b/src/workspace/docs/builtin/double.md new file mode 100644 index 0000000..6fa7967 --- /dev/null +++ b/src/workspace/docs/builtin/double.md @@ -0,0 +1,5 @@ +*double* builtin type, + +--- +A double-precision floating point number (IEEE-745.2008 binary64). + diff --git a/src/workspace/docs/builtin/fixed32.md b/src/workspace/docs/builtin/fixed32.md new file mode 100644 index 0000000..21442a6 --- /dev/null +++ b/src/workspace/docs/builtin/fixed32.md @@ -0,0 +1,5 @@ +*fixed32* builtin type, A 32-bit unsigned integer (4-byte encoding) + +--- +Values of this type range between `0` and `4294967295`. + diff --git a/src/workspace/docs/builtin/fixed64.md b/src/workspace/docs/builtin/fixed64.md new file mode 100644 index 0000000..1134466 --- /dev/null +++ b/src/workspace/docs/builtin/fixed64.md @@ -0,0 +1,5 @@ +*fixed64* builtin type, A 64-bit unsigned integer (8-byte encoding) + +--- +Values of this type range between `0` and `18446744073709551615`. + diff --git a/src/workspace/docs/builtin/float.md b/src/workspace/docs/builtin/float.md new file mode 100644 index 0000000..296e26c --- /dev/null +++ b/src/workspace/docs/builtin/float.md @@ -0,0 +1,5 @@ +*float* builtin type + +--- +A single-precision floating point number (IEEE-745.2008 binary32). + diff --git a/src/workspace/docs/builtin/int32.md b/src/workspace/docs/builtin/int32.md new file mode 100644 index 0000000..7a3fd02 --- /dev/null +++ b/src/workspace/docs/builtin/int32.md @@ -0,0 +1,5 @@ +*int32* builtin type, A 32-bit integer (varint encoding) + +--- +Values of this type range between `-2147483648` and `2147483647`. +Beware that negative values are encoded as five bytes on the wire! diff --git a/src/workspace/docs/builtin/int64.md b/src/workspace/docs/builtin/int64.md new file mode 100644 index 0000000..f440877 --- /dev/null +++ b/src/workspace/docs/builtin/int64.md @@ -0,0 +1,5 @@ +*int64* builtin type, A 64-bit integer (varint encoding) + +--- +Values of this type range between `-9223372036854775808` and `9223372036854775807`. +Beware that negative values are encoded as ten bytes on the wire! diff --git a/src/workspace/docs/builtin/sfixed32.md b/src/workspace/docs/builtin/sfixed32.md new file mode 100644 index 0000000..23f0c5d --- /dev/null +++ b/src/workspace/docs/builtin/sfixed32.md @@ -0,0 +1,5 @@ +*sfixed32* builtin type, A 32-bit integer (4-byte encoding) + +--- +Values of this type range between `-2147483648` and `2147483647`. + diff --git a/src/workspace/docs/builtin/sfixed64.md b/src/workspace/docs/builtin/sfixed64.md new file mode 100644 index 0000000..c74f0a3 --- /dev/null +++ b/src/workspace/docs/builtin/sfixed64.md @@ -0,0 +1,4 @@ +*sfixed64* builtin type, A 64-bit integer (8-byte encoding) + +--- +Values of this type range between `-9223372036854775808` and `9223372036854775807`. diff --git a/src/workspace/docs/builtin/sint32.md b/src/workspace/docs/builtin/sint32.md new file mode 100644 index 0000000..a890611 --- /dev/null +++ b/src/workspace/docs/builtin/sint32.md @@ -0,0 +1,5 @@ +*sint32* builtin type, A 32-bit integer (ZigZag encoding) + +--- +Values of this type range between `-2147483648` and `2147483647`. + diff --git a/src/workspace/docs/builtin/sint64.md b/src/workspace/docs/builtin/sint64.md new file mode 100644 index 0000000..3465966 --- /dev/null +++ b/src/workspace/docs/builtin/sint64.md @@ -0,0 +1,5 @@ +*sint64* builtin type, A 64-bit integer (ZigZag encoding) + +--- +Values of this type range between `-9223372036854775808` and `9223372036854775807`. + diff --git a/src/workspace/docs/builtin/string.md b/src/workspace/docs/builtin/string.md new file mode 100644 index 0000000..05d9347 --- /dev/null +++ b/src/workspace/docs/builtin/string.md @@ -0,0 +1,4 @@ +*string* builtin type, A string of text. + +--- +Stores at most 4GB of text. Intended to be UTF-8 encoded Unicode; use `bytes` if you need other encodings. diff --git a/src/workspace/docs/builtin/uint32.md b/src/workspace/docs/builtin/uint32.md new file mode 100644 index 0000000..8f3da1a --- /dev/null +++ b/src/workspace/docs/builtin/uint32.md @@ -0,0 +1,5 @@ +*uint32* builtin type, A 32-bit unsigned integer (varint encoding) + +--- +Values of this type range between `0` and `4294967295`. + diff --git a/src/workspace/docs/builtin/uint64.md b/src/workspace/docs/builtin/uint64.md new file mode 100644 index 0000000..6423ee9 --- /dev/null +++ b/src/workspace/docs/builtin/uint64.md @@ -0,0 +1,5 @@ +*uint64* builtin type, A 64-bit unsigned integer (varint encoding) + +--- +Values of this type range between `0` and `18446744073709551615`. + diff --git a/src/workspace/docs/wellknown/Any.md b/src/workspace/docs/wellknown/Any.md new file mode 100644 index 0000000..c716295 --- /dev/null +++ b/src/workspace/docs/wellknown/Any.md @@ -0,0 +1,11 @@ +*google.protobuf.Any* wellknown type +--- +`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message. +The JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL. +--- +```proto +message Any { + string type_url = 1; // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message + bytes value = 2; // Must be a valid serialized protocol buffer +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Api.md b/src/workspace/docs/wellknown/Api.md new file mode 100644 index 0000000..65bed32 --- /dev/null +++ b/src/workspace/docs/wellknown/Api.md @@ -0,0 +1,15 @@ +*google.protobuf.Api* well known type +--- +`Api` is a light-weight descriptor for a protocol buffer service. +--- +```proto +message Api { + string name = 1; // The fully qualified name of this api, including package name followed by the api's simple name + repeated Method methods = 2; // The methods of this api, in unspecified order + repeated Option options = 3; // Any metadata attached to the API + string version = 4; // A version string fo this interface + SourceContext source_context = 5; // Source context for the protocol buffer service + repeated Mixin mixins = 6; // Included interfaces + Syntax syntax = 7; // Source syntax of the service +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/BoolValue.md b/src/workspace/docs/wellknown/BoolValue.md new file mode 100644 index 0000000..d2fb16a --- /dev/null +++ b/src/workspace/docs/wellknown/BoolValue.md @@ -0,0 +1,9 @@ +*google.protobuf.BoolValue* well known type, Wrapper message for bool +--- +The JSON representation for `BoolValue` is JSON `true` and `false` +--- +```proto +message BoolValue { + bool value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/BytesValue.md b/src/workspace/docs/wellknown/BytesValue.md new file mode 100644 index 0000000..0f7d3b8 --- /dev/null +++ b/src/workspace/docs/wellknown/BytesValue.md @@ -0,0 +1,9 @@ +*google.protobuf.BytesValue* well known type, Wrapper message for bytes +--- +The JSON representation for `BytesValue` is JSON string. +--- +```proto +message BytesValue { + bytes value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/DoubleValue.md b/src/workspace/docs/wellknown/DoubleValue.md new file mode 100644 index 0000000..d7aad4a --- /dev/null +++ b/src/workspace/docs/wellknown/DoubleValue.md @@ -0,0 +1,9 @@ +*google.protobuf.DoubleValue* well known type, Wrapper message for `double` +--- +The JSON representation for `DoubleValue` is JSON number. +--- +```proto +message DoubleValue { + double value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Duration.md b/src/workspace/docs/wellknown/Duration.md new file mode 100644 index 0000000..acc5125 --- /dev/null +++ b/src/workspace/docs/wellknown/Duration.md @@ -0,0 +1,13 @@ +*google.protobuf.Duration* well known type +--- +A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. +It is independent of any calendar and concepts like "day" or "month". +It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. +Range is approximately +-10,000 years. +--- +```proto +message Duration { + int64 seconds = 1; // Signed seconds of the span of time Must be from -315,576,000,000 to +315,576,000,000 inclusive + int32 nanos = 2; // Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 `seconds` field and a positive or negative `nanos` field. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Empty.md b/src/workspace/docs/wellknown/Empty.md new file mode 100644 index 0000000..d817e54 --- /dev/null +++ b/src/workspace/docs/wellknown/Empty.md @@ -0,0 +1,4 @@ +*google.protobuf.Empty* well known type +--- +A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. +The JSON representation for Empty is empty JSON object `{}` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Enum.md b/src/workspace/docs/wellknown/Enum.md new file mode 100644 index 0000000..385e8c0 --- /dev/null +++ b/src/workspace/docs/wellknown/Enum.md @@ -0,0 +1,14 @@ +*google.protobuf.Enum* well known type +--- +Enum type definition +--- +```proto +message Enum { + string name = 1; // Enum type name. + repeated EnumValue enumvalue = 2; // Enum value definitions. + repeated Option options = 3; // Protocol buffer options. + SourceContext source_context = 4; // The source context. + Syntax syntax = 5; // The source syntax. + string edition = 6; // The source edition string, only valid when syntax is SYNTAX_EDITIONS. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/EnumValue.md b/src/workspace/docs/wellknown/EnumValue.md new file mode 100644 index 0000000..c596159 --- /dev/null +++ b/src/workspace/docs/wellknown/EnumValue.md @@ -0,0 +1,11 @@ +*google.protobuf.EnumValue* well known type +--- +Enum value definition +--- +```proto +message EnumValue { + string name = 1; // Enum value name. + int32 number = 2; // Enum value number. + repeated Option options = 3; // Protocol buffer options. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Field.Cardinality.md b/src/workspace/docs/wellknown/Field.Cardinality.md new file mode 100644 index 0000000..116ff39 --- /dev/null +++ b/src/workspace/docs/wellknown/Field.Cardinality.md @@ -0,0 +1,12 @@ +*google.protobuf.Field.Cardinality* well known type +--- +Whether a field is optional, required, or repeated. +--- +```proto +enum Cardinality { + CARDINALITY_UNKNOWN = 0; // For fields with unknown cardinality. + CARDINALITY_OPTIONAL = 1; // For optional fields. + CARDINALITY_REQUIRED = 2; // For required fields. Proto2 syntax only. + CARDINALITY_REPEATED = 3; // For repeated fields. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Field.Kind.md b/src/workspace/docs/wellknown/Field.Kind.md new file mode 100644 index 0000000..df4f112 --- /dev/null +++ b/src/workspace/docs/wellknown/Field.Kind.md @@ -0,0 +1,27 @@ +*google.protobuf.Field.Kind* well known type +--- +Basic field types. +--- +```proto +enum Kind { + TYPE_UNKNOWN = 0; // Field type unknown. + TYPE_DOUBLE = 1; // Field type double. + TYPE_FLOAT = 2; // Field type float. + TYPE_INT64 = 3; // Field type int64. + TYPE_UINT64 = 4; // Field type uint64. + TYPE_INT32 = 5; // Field type int32. + TYPE_FIXED64 = 6; // Field type fixed64. + TYPE_FIXED32 = 7; // Field type fixed32. + TYPE_BOOL = 8; // Field type bool. + TYPE_STRING = 9; // Field type string. + TYPE_GROUP = 10; // Field type group. Proto2 syntax only, and deprecated. + TYPE_MESSAGE = 11; // Field type message. + TYPE_BYTES = 12; // Field type bytes. + TYPE_UINT32 = 13; // Field type uint32. + TYPE_ENUM = 14; // Field type enum. + TYPE_SFIXED32 = 15; // Field type sfixed32. + TYPE_SFIXED64 = 16; // Field type sfixed64. + TYPE_SINT32 = 17; // Field type sint32. + TYPE_SINT64 = 18; // Field type sint64. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Field.md b/src/workspace/docs/wellknown/Field.md new file mode 100644 index 0000000..7c0e9c8 --- /dev/null +++ b/src/workspace/docs/wellknown/Field.md @@ -0,0 +1,18 @@ +*google.protobuf.Field* well known type +--- +A single field of a message type. +--- +```proto +message Field { + Kind kind = 1; // The field type. + Cardinality cardinality = 2; // The field cardinality. + int32 number = 3; // The field number. + string name = 4; // The field name. + string type_url = 6; // The field type URL, without the scheme, for message or enumeration types + int32 oneof_index = 7; // The index of the field type in `Type.oneofs`, for message or enumeration types. + bool packed = 8; // Whether to use alternative packed wire representation. + repeated Option options = 9; // The protocol buffer options. + string json_name = 10; // The field JSON name. + string default_value = 11; // The string value of the default value of this field. Proto2 syntax only. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/FieldMask.md b/src/workspace/docs/wellknown/FieldMask.md new file mode 100644 index 0000000..568b087 --- /dev/null +++ b/src/workspace/docs/wellknown/FieldMask.md @@ -0,0 +1,9 @@ +*google.protobuf.FieldMask* well known type +--- +`FieldMask` represents a set of symbolic field paths +--- +```proto +message FieldMask { + repeated string paths = 1; // The set of field mask paths. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/FloatValue.md b/src/workspace/docs/wellknown/FloatValue.md new file mode 100644 index 0000000..171dc20 --- /dev/null +++ b/src/workspace/docs/wellknown/FloatValue.md @@ -0,0 +1,9 @@ +*google.protobuf.FloatValue* well known type, Wrapper message for `float` +--- +The JSON representation for `FloatValue` is JSON number. +--- +```proto +message FloatValue { + float value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Int32Value.md b/src/workspace/docs/wellknown/Int32Value.md new file mode 100644 index 0000000..bbe5b8b --- /dev/null +++ b/src/workspace/docs/wellknown/Int32Value.md @@ -0,0 +1,9 @@ +*google.protobuf.Int32Value* well known type, Wrapper message for `int32` +--- +The JSON representation for `Int32Value` is JSON number. +--- +```proto +message Int32Value { + int32 value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Int64Value.md b/src/workspace/docs/wellknown/Int64Value.md new file mode 100644 index 0000000..fc465aa --- /dev/null +++ b/src/workspace/docs/wellknown/Int64Value.md @@ -0,0 +1,9 @@ +*google.protobuf.Int64Value* well known type, Wrapper message for `int64` +--- +The JSON representation for `Int64Value` is JSON string +--- +```proto +message Int64Value { + int64 value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/ListValue.md b/src/workspace/docs/wellknown/ListValue.md new file mode 100644 index 0000000..c437596 --- /dev/null +++ b/src/workspace/docs/wellknown/ListValue.md @@ -0,0 +1,10 @@ +*google.protobuf.ListValue* well known type +--- +`ListValue` is a wrapper around a repeated field of values. +The JSON representation for `ListValue` is JSON array. +--- +```proto +message ListValue { + repeated Value values = 1; // Repeated field of dynamically typed values. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Method.md b/src/workspace/docs/wellknown/Method.md new file mode 100644 index 0000000..02d55b7 --- /dev/null +++ b/src/workspace/docs/wellknown/Method.md @@ -0,0 +1,15 @@ +*google.protobuf.Method* well known type +--- +Method represents a method of an API interface. +--- +```proto +message Method { + string name = 1; // The simple name of this method. + string request_type_url = 2; // A URL of the input message type. + bool request_streaming = 3; // If true, the request is streamed. + string response_type_url = 4; // The URL of the output message type. + bool response_streaming = 5; // If true, the response is streamed. + repeated Option options = 6; // Any metadata attached to the method. + Syntax syntax = 7; // The source syntax of this method. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Mixin.md b/src/workspace/docs/wellknown/Mixin.md new file mode 100644 index 0000000..a8e2680 --- /dev/null +++ b/src/workspace/docs/wellknown/Mixin.md @@ -0,0 +1,10 @@ +*google.protobuf.Mixin* well known type +--- +Declares an API Interface to be included in this interface. +--- +```proto +message Mixin { + string name = 1; // The fully qualified name of the interface which is included. + string root = 2; // If non-empty specifies a path under which the interface is served. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/NullValue.md b/src/workspace/docs/wellknown/NullValue.md new file mode 100644 index 0000000..75a7e62 --- /dev/null +++ b/src/workspace/docs/wellknown/NullValue.md @@ -0,0 +1,10 @@ +*google.protobuf.NullValue* well known type +--- +`NullValue` is a singleton enumeration to represent the null value for the `Value` type union. +The JSON representation for `NullValue` is JSON `null`. +--- +```proto +enum NullValue { + NULL_VALUE = 0; // Null value. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Option.md b/src/workspace/docs/wellknown/Option.md new file mode 100644 index 0000000..65097f6 --- /dev/null +++ b/src/workspace/docs/wellknown/Option.md @@ -0,0 +1,10 @@ +*google.protobuf.Option* well known type +--- +A protocol buffer option, which can be attached to a message, field, enumeration, etc. +--- +```proto +message Option { + string name = 1; // The option's name. For example, "java_package". + Any value = 2; // The option's value. For example, "com.google.protobuf". +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/SourceContext.md b/src/workspace/docs/wellknown/SourceContext.md new file mode 100644 index 0000000..6d0b878 --- /dev/null +++ b/src/workspace/docs/wellknown/SourceContext.md @@ -0,0 +1,9 @@ +*google.protobuf.SourceContext* well known type +--- +`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined. +--- +```proto +message SourceContext { + string file_name = 1; // The path-qualified name of the .proto file that contained the associated protobuf element. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/StringValue.md b/src/workspace/docs/wellknown/StringValue.md new file mode 100644 index 0000000..528c44c --- /dev/null +++ b/src/workspace/docs/wellknown/StringValue.md @@ -0,0 +1,9 @@ +*google.protobuf.StringValue* well known type, Wrapper message for `string` +--- +The JSON representation for `StringValue` is JSON string +--- +```proto +message StringValue { + string value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Struct.md b/src/workspace/docs/wellknown/Struct.md new file mode 100644 index 0000000..addecbb --- /dev/null +++ b/src/workspace/docs/wellknown/Struct.md @@ -0,0 +1,9 @@ +*google.protobuf.Struct* well known type +--- +`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. +--- +```proto +message Struct { + map fields = 1; // Unordered map of dynamically typed values. +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Syntax.md b/src/workspace/docs/wellknown/Syntax.md new file mode 100644 index 0000000..5511621 --- /dev/null +++ b/src/workspace/docs/wellknown/Syntax.md @@ -0,0 +1,11 @@ +*google.protobuf.Syntax* well known type +--- +The syntax in which a protocol buffer element is defined +--- +```proto +enum Syntax { + SYNTAX_PROTO2 = 1; + SYNTAX_PROTO3 = 2; + SYNTAX_EDITIONS = 3; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Timestamp.md b/src/workspace/docs/wellknown/Timestamp.md new file mode 100644 index 0000000..35c0c41 --- /dev/null +++ b/src/workspace/docs/wellknown/Timestamp.md @@ -0,0 +1,12 @@ +*google.protobuf.Timestamp* well known type +--- +A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. + +It is encoded using the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. +--- +```proto +message Timestamp { + int64 seconds = 1; // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z + int32 nanos = 2; // Non-negative fractions of a second at nanosecond resolution +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Type.md b/src/workspace/docs/wellknown/Type.md new file mode 100644 index 0000000..ab7dc32 --- /dev/null +++ b/src/workspace/docs/wellknown/Type.md @@ -0,0 +1,15 @@ +*google.protobuf.Type* well known type +--- +A protocol buffer message type. +--- +```proto +message Type { + string name = 1; // The fully qualified message name + repeated Field fields = 2; // The list of fields + repeated string oneofs = 3; // The list of types appearing in `oneof` definitions in this type + repeated Option options = 4; // The protocol buffer options + SourceContext source_context = 5; // The source context + Syntax syntax = 6; // The source syntax + string edition = 7; // The source edition string, only valid when syntax is SYNTAX_EDITIONS +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/UInt32Value.md b/src/workspace/docs/wellknown/UInt32Value.md new file mode 100644 index 0000000..ba20a67 --- /dev/null +++ b/src/workspace/docs/wellknown/UInt32Value.md @@ -0,0 +1,9 @@ +*google.protobuf.UInt32Value* well known type, Wrapper message for `uint32` +--- +The JSON representation for `UInt32Value` is JSON number +--- +```proto +message UInt32Value { + uint32 value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/UInt64Value.md b/src/workspace/docs/wellknown/UInt64Value.md new file mode 100644 index 0000000..2f05d8d --- /dev/null +++ b/src/workspace/docs/wellknown/UInt64Value.md @@ -0,0 +1,9 @@ +*google.protobuf.UInt64Value* well known type, Wrapper message for `uint64` +--- +The JSON representation for `UInt64Value` is JSON string +--- +```proto +message UInt64Value { + uint64 value = 1; +} +``` \ No newline at end of file diff --git a/src/workspace/docs/wellknown/Value.md b/src/workspace/docs/wellknown/Value.md new file mode 100644 index 0000000..0ff7293 --- /dev/null +++ b/src/workspace/docs/wellknown/Value.md @@ -0,0 +1,16 @@ +*google.protobuf.Value* well known type +--- +`Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. +--- +```proto +message Value { + oneof kind { + NullValue null_value = 1; + double number_value = 2; + string string_value = 3; + bool bool_value = 4; + Struct struct_value = 5; + ListValue list_value = 6; + } +} +``` \ No newline at end of file diff --git a/src/workspace/hover.rs b/src/workspace/hover.rs index f5e9f2f..058e970 100644 --- a/src/workspace/hover.rs +++ b/src/workspace/hover.rs @@ -8,582 +8,57 @@ use crate::{ static BUITIN_DOCS: LazyLock> = LazyLock::new(|| { HashMap::from([ - ( - "int32", - r#"*int32* builtin type, A 32-bit integer (varint encoding) ---- -Values of this type range between `-2147483648` and `2147483647`. -Beware that negative values are encoded as five bytes on the wire!"#, - ), - ( - "int64", - r#"*int64* builtin type, A 64-bit integer (varint encoding) ---- -Values of this type range between `-9223372036854775808` and `9223372036854775807`. -Beware that negative values are encoded as ten bytes on the wire!"#, - ), - ( - "uint32", - r#"*uint32* builtin type, A 32-bit unsigned integer (varint encoding) ---- -Values of this type range between `0` and `4294967295`."#, - ), - ( - "uint64", - r#"*uint64* builtin type, A 64-bit unsigned integer (varint encoding) ---- -Values of this type range between `0` and `18446744073709551615`."#, - ), - ( - "sint32", - r#"*sint32* builtin type, A 32-bit integer (ZigZag encoding) ---- -Values of this type range between `-2147483648` and `2147483647`."#, - ), - ( - "sint64", - r#"*sint64* builtin type, A 64-bit integer (ZigZag encoding) ---- -Values of this type range between `-9223372036854775808` and `9223372036854775807`."#, - ), - ( - "fixed32", - r#"*fixed32* builtin type, A 32-bit unsigned integer (4-byte encoding) - -Values of this type range between `0` and `4294967295`."#, - ), - ( - "fixed64", - r#"*fixed64* builtin type, A 64-bit unsigned integer (8-byte encoding) ---- -Values of this type range between `0` and `18446744073709551615`."#, - ), - ( - "sfixed32", - r#"*sfixed64* builtin type, A 32-bit integer (4-byte encoding) ---- -Values of this type range between `-2147483648` and `2147483647`."#, - ), - ( - "sfixed64", - r#"*sfixed64* builtin type, A 64-bit integer (8-byte encoding) ---- -Values of this type range between `-9223372036854775808` and `9223372036854775807`."#, - ), - ( - "float", - r#"*float* builtin type ---- -A single-precision floating point number (IEEE-745.2008 binary32)."#, - ), - ( - "double", - r#"*double* builtin type, ---- -A double-precision floating point number (IEEE-745.2008 binary64)."#, - ), - ( - "string", - r#"*string* builtin type, A string of text. ---- -Stores at most 4GB of text. Intended to be UTF-8 encoded Unicode; use `bytes` if you need other encodings."#, - ), - ( - "bytes", - r#"*bytes* builtin type, A blob of arbitrary bytes. ---- -Stores at most 4GB of binary data. Encoded as base64 in JSON."#, - ), - ( - "bool", - r#"*bool* builtin type, A Boolean value: `true` or `false`. ---- -Encoded as a single byte: `0x00` or `0xff` (all non-zero bytes decode to `true`)."#, - ), - ( - "default", - r#"*default* builtin type, A magic option that specifies the field's default value. ---- -Unlike every other option on a field, this does not have a corresponding field in -`google.protobuf.FieldOptions`; it is implemented by compiler magic."#, - ), + ("int32", include_str!("docs/builtin/int32.md")), + ("int64", include_str!("docs/builtin/int64.md")), + ("uint32", include_str!("docs/builtin/uint32.md")), + ("uint64", include_str!("docs/builtin/uint64.md")), + ("sint32", include_str!("docs/builtin/sint32.md")), + ("sint64", include_str!("docs/builtin/sint64.md")), + ("fixed32", include_str!("docs/builtin/fixed32.md")), + ("fixed64", include_str!("docs/builtin/fixed64.md")), + ("sfixed32", include_str!("docs/builtin/sfixed32.md")), + ("sfixed64", include_str!("docs/builtin/sfixed64.md")), + ("float", include_str!("docs/builtin/float.md")), + ("double", include_str!("docs/builtin/double.md")), + ("string", include_str!("docs/builtin/string.md")), + ("bytes", include_str!("docs/builtin/bytes.md")), + ("bool", include_str!("docs/builtin/bool.md")), + ("default", include_str!("docs/builtin/default.md")), ]) }); static WELLKNOWN_DOCS: LazyLock> = LazyLock::new(|| { HashMap::from([ - ( - "google.protobuf.Any", - r#"*google.protobuf.Any* wellknown type ---- -`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message. -The JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL. ---- -```proto -message Any { - string type_url = 1; // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message - bytes value = 2; // Must be a valid serialized protocol buffer -} -``` - -"#, - ), - ( - "google.protobuf.Api", - r#"*google.protobuf.Api* well known type ---- -`Api` is a light-weight descriptor for a protocol buffer service. ---- -```proto -message Api { - string name = 1; // The fully qualified name of this api, including package name followed by the api's simple name - repeated Method methods = 2; // The methods of this api, in unspecified order - repeated Option options = 3; // Any metadata attached to the API - string version = 4; // A version string fo this interface - SourceContext source_context = 5; // Source context for the protocol buffer service - repeated Mixin mixins = 6; // Included interfaces - Syntax syntax = 7; // Source syntax of the service -} -``` - -"#, - ), - ( - "google.protobuf.BoolValue", - r#"*google.protobuf.BoolValue* well known type, Wrapper message for bool ---- -The JSON representation for `BoolValue` is JSON `true` and `false` ---- -```proto -message BoolValue { - bool value = 1; -} -``` -"#, - ), - ( - "google.protobuf.BytesValue", - r#"*google.protobuf.BytesValue* well known type, Wrapper message for bytes ---- -The JSON representation for `BytesValue` is JSON string. ---- -```proto -message BytesValue { - bytes value = 1; -} -``` -"#, - ), - ( - "google.protobuf.DoubleValue", - r#"*google.protobuf.DoubleValue* well known type, Wrapper message for double ---- -The JSON representation for `DoubleValue` is JSON number. ---- -```proto -message DoubleValue { - double value = 1; -} -``` -"#, - ), - ( - "google.protobuf.Duration", - r#"*google.protobuf.Duration* well known type ---- -A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. -It is independent of any calendar and concepts like "day" or "month". -It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. -Range is approximately +-10,000 years. ---- -```proto -message Duration { - int64 seconds = 1; // Signed seconds of the span of time Must be from -315,576,000,000 to +315,576,000,000 inclusive - int32 nanos = 2; // Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 `seconds` field and a positive or negative `nanos` field. -} -``` -"#, - ), - ( - "google.protobuf.Empty", - r#"*google.protobuf.Empty* well known type ---- -A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. -The JSON representation for Empty is empty JSON object `{}` -"#, - ), - ( - "google.protobuf.Enum", - r#"*google.protobuf.Enum* well known type ---- -Enum type definition ---- -```proto -message Enum { - string name = 1; // Enum type name. - repeated EnumValue enumvalue = 2; // Enum value definitions. - repeated Option options = 3; // Protocol buffer options. - SourceContext source_context = 4; // The source context. - Syntax syntax = 5; // The source syntax. - string edition = 6; // The source edition string, only valid when syntax is SYNTAX_EDITIONS. -} -``` -"#, - ), - ( - "google.protobuf.EnumValue", - r#"*google.protobuf.EnumValue* well known type ---- -Enum value definition ---- -```proto -message EnumValue { - string name = 1; // Enum value name. - int32 number = 2; // Enum value number. - repeated Option options = 3; // Protocol buffer options. -} - -``` -"#, - ), - ( - "google.protobuf.Field", - r#"*google.protobuf.Field* well known type ---- -A single field of a message type. ---- -```proto -message Field { - Kind kind = 1; // The field type. - Cardinality cardinality = 2; // The field cardinality. - int32 number = 3; // The field number. - string name = 4; // The field name. - string type_url = 6; // The field type URL, without the scheme, for message or enumeration types - int32 oneof_index = 7; // The index of the field type in `Type.oneofs`, for message or enumeration types. - bool packed = 8; // Whether to use alternative packed wire representation. - repeated Option options = 9; // The protocol buffer options. - string json_name = 10; // The field JSON name. - string default_value = 11; // The string value of the default value of this field. Proto2 syntax only. -} -``` -"#, - ), - ( - "google.protobuf.Field.Cardinality", - r#"*google.protobuf.Field.Cardinality* well known type ---- -Whether a field is optional, required, or repeated. ---- -```proto -enum Cardinality { - CARDINALITY_UNKNOWN = 0; // For fields with unknown cardinality. - CARDINALITY_OPTIONAL = 1; // For optional fields. - CARDINALITY_REQUIRED = 2; // For required fields. Proto2 syntax only. - CARDINALITY_REPEATED = 3; // For repeated fields. -} - -``` -"#, - ), - ( - "google.protobuf.Field.Kind", - r#"*google.protobuf.Field.Kind* well known type ---- -Basic field types. ---- -```proto -enum Kind { - TYPE_UNKNOWN = 0; // Field type unknown. - TYPE_DOUBLE = 1; // Field type double. - TYPE_FLOAT = 2; // Field type float. - TYPE_INT64 = 3; // Field type int64. - TYPE_UINT64 = 4; // Field type uint64. - TYPE_INT32 = 5; // Field type int32. - TYPE_FIXED64 = 6; // Field type fixed64. - TYPE_FIXED32 = 7; // Field type fixed32. - TYPE_BOOL = 8; // Field type bool. - TYPE_STRING = 9; // Field type string. - TYPE_GROUP = 10; // Field type group. Proto2 syntax only, and deprecated. - TYPE_MESSAGE = 11; // Field type message. - TYPE_BYTES = 12; // Field type bytes. - TYPE_UINT32 = 13; // Field type uint32. - TYPE_ENUM = 14; // Field type enum. - TYPE_SFIXED32 = 15; // Field type sfixed32. - TYPE_SFIXED64 = 16; // Field type sfixed64. - TYPE_SINT32 = 17; // Field type sint32. - TYPE_SINT64 = 18; // Field type sint64. -} - -``` -"#, - ), - ( - "google.protobuf.FieldMask", - r#"*google.protobuf.FieldMask* well known type ---- -`FieldMask` represents a set of symbolic field paths ---- -```proto -message FieldMask { - repeated string paths = 1; // The set of field mask paths. -} - -``` -"#, - ), - ( - "google.protobuf.FloatValue", - r#"*google.protobuf.FloatValue* well known type, Wrapper message for `float` ---- -The JSON representation for `FloatValue` is JSON number. ---- -```proto -message FloatValue { - float value = 1; -} -``` -"#, - ), - ( - "google.protobuf.Int32Value", - r#"*google.protobuf.Int32Value* well known type, Wrapper message for `int32` ---- -The JSON representation for `Int32Value` is JSON number. ---- -```proto -message Int32Value { - int32 value = 1; -} -``` -"#, - ), - ( - "google.protobuf.Int64Value", - r#"*google.protobuf.Int64Value* well known type, Wrapper message for `int64` ---- -The JSON representation for `Int64Value` is JSON string. ---- -```proto -message Int64Value { - int64 value = 1; -} -``` -"#, - ), - ( - "google.protobuf.ListValue", - r#"*google.protobuf.ListValue* well known type, Wrapper around a repeated field of values ---- -The JSON representation for `ListValue` is JSON Array. ---- -```proto -message Int64Value { - Value values = 1; -} -``` -"#, - ), - ( - "google.protobuf.Method", - r#"*google.protobuf.Method* well known type ---- -Method represents a method of an api. ---- -```proto -message Method { - string name = 1; // The simple name of this method. - string request_type_url = 2; // A URL of the input message type. - bool request_streaming = 3; // If true, the request is streamed. - string response_type_url = 4; // The URL of the output message type. - bool response_streaming = 5; // If true, the response is streamed. - repeated Option options = 6; // Any metadata attached to the method. - Syntax syntax = 7; // The source syntax of this method. -} -``` -"#, - ), - ( - "google.protobuf.Mixin", - r#"*google.protobuf.Mixin* well known type ---- -Declares an API Interface to be included in this interface. The including -interface must redeclare all the methods from the included interface, but -documentation and options are inherited ---- -```proto -message Mixin { - string name = 1; // The fully qualified name of the interface which is included. - string root = 2; // If non-empty specifies a path under which inherited HTTP paths are rooted. -} -``` -"#, - ), - ( - "google.protobuf.NullValue", - r#"*google.protobuf.NullValue* well known type ---- -`NullValue` is a singleton enumeration to represent the null value for the Value type union. -The JSON representation for NullValue is JSON `null`. ---- -```proto -enum NullValue { - NULL_VALUE = 1; -} -``` -"#, - ), - ( - "google.protobuf.Option", - r#"*google.protobuf.Option* well known type ---- -A protocol buffer option, which can be attached to a message, field, enumeration, etc ---- -```proto -message Option { - string name = 1; // The option's name - Any value = 2; // The option's value -} -``` -"#, - ), - ( - "google.protobuf.SourceContext", - r#"*google.protobuf.SourceContext* well known type ---- -`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined ---- -```proto -message SourceContext { - string file_name = 1; // The path-qualified name of the .proto file that contained the associated protobuf element. -} -``` -"#, - ), - ( - "google.protobuf.StringValue", - r#"*google.protobuf.StringValue* well known type, Wrapper message for string. ---- -The JSON representation for `StringValue` is JSON string. ---- -```proto -message StringValue { - string value = 1; -} -``` -"#, - ), - ( - "google.protobuf.Struct", - r#"*google.protobuf.Struct* well known type ---- -`Struct` represents a structured data value, consisting of fields -which map to dynamically typed values. ---- -```proto -message Struct { - map fields = 1; // Unordered map of dynamically typed values. -} -``` -"#, - ), - ( - "google.protobuf.Syntax", - r#"*google.protobuf.Syntax* well known type ---- -The syntax in which a protocol buffer element is defined ---- -```proto -enum Syntax { - SYNTAX_PROTO2 = 1; - SYNTAX_PROTO3 = 2; - SYNTAX_EDITIONS = 3; -} -``` -"#, - ), - ( - "google.protobuf.Timestamp", - r#"*google.protobuf.Timestamp* well known type ---- -`Timestamp` represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time ---- -```proto -message Timestamp { - int64 seconds = 1; // Represents seconds of UTC time since Unix epoch - int32 nanos = 2; // Non-negative fractions of a second at nanosecond resolution. -} -``` -"#, - ), - ( - "google.protobuf.Type", - r#"*google.protobuf.Type* well known type ---- -A protocol buffer message type ---- -```proto -message Type { - string name = 1; // The fully qualified message name. - repeated Field fields = 2; // The list of fields. - repeated string oneofs = 3; // The list of types appearing in `oneof` definitions in this type. - repeated Option options = 4; // The protocol buffer options. - SourceContext source_context = 5; // The source context. - Syntax syntax = 6; // The source syntax. - string edition = 7; // The source edition string, only valid when syntax is SYNTAX_EDITIONS. -} -``` -"#, - ), - ( - "google.protobuf.UInt32Value", - r#"*google.protobuf.UInt32Value* well known type, Wrapper message for `uint32` ---- -The JSON representation for `UInt32Value` is JSON number. ---- -```proto -message UInt32Value { - uint32 value = 1; -} -``` -"#, - ), - ( - "google.protobuf.UInt64Value", - r#"*google.protobuf.UInt64Value* well known type, Wrapper message for `uint64` ---- -The JSON representation for `UInt64Value` is JSON string. ---- -```proto -message UInt64Value { - uint64 value = 1; -} -``` -"#, - ), - ( - "google.protobuf.Value", - r#"*google.protobuf.Value* well known type ---- -`Value` represents a dynamically typed value which can be either -null, a number, a string, a boolean, a recursive struct value, or a -list of values. - -The JSON representation for `Value` is JSON value. ---- -```proto -message Value { - oneof kind { - NullValue null_value = 1; // Represents a null value. - double number_value = 2; // Represents a double value. - string string_value = 3; // Represents a string value. - bool bool_value = 4; // Represents a boolean value. - Struct struct_value = 5; // Represents a structured value. - ListValue list_value = 6; // Represents a repeated `Value`. - } -} -``` -"#, - ), + ("google.protobuf.Any", include_str!("docs/wellknown/Any.md")), + ("google.protobuf.Api", include_str!("docs/wellknown/Api.md")), + ("google.protobuf.BoolValue", include_str!("docs/wellknown/BoolValue.md")), + ("google.protobuf.BytesValue", include_str!("docs/wellknown/BytesValue.md")), + ("google.protobuf.DoubleValue", include_str!("docs/wellknown/DoubleValue.md")), + ("google.protobuf.Duration", include_str!("docs/wellknown/Duration.md")), + ("google.protobuf.Empty", include_str!("docs/wellknown/Empty.md")), + ("google.protobuf.Enum", include_str!("docs/wellknown/Enum.md")), + ("google.protobuf.EnumValue", include_str!("docs/wellknown/EnumValue.md")), + ("google.protobuf.Field", include_str!("docs/wellknown/Field.md")), + ("google.protobuf.Field.Cardinality", include_str!("docs/wellknown/Field.Cardinality.md")), + ("google.protobuf.Field.Kind", include_str!("docs/wellknown/Field.Kind.md")), + ("google.protobuf.FieldMask", include_str!("docs/wellknown/FieldMask.md")), + ("google.protobuf.FloatValue", include_str!("docs/wellknown/FloatValue.md")), + ("google.protobuf.Int32Value", include_str!("docs/wellknown/Int32Value.md")), + ("google.protobuf.Int64Value", include_str!("docs/wellknown/Int64Value.md")), + ("google.protobuf.ListValue", include_str!("docs/wellknown/ListValue.md")), + ("google.protobuf.Method", include_str!("docs/wellknown/Method.md")), + ("google.protobuf.Mixin", include_str!("docs/wellknown/Mixin.md")), + ("google.protobuf.NullValue", include_str!("docs/wellknown/NullValue.md")), + ("google.protobuf.Option", include_str!("docs/wellknown/Option.md")), + ("google.protobuf.SourceContext", include_str!("docs/wellknown/SourceContext.md")), + ("google.protobuf.StringValue", include_str!("docs/wellknown/StringValue.md")), + ("google.protobuf.Struct", include_str!("docs/wellknown/Struct.md")), + ("google.protobuf.Syntax", include_str!("docs/wellknown/Syntax.md")), + ("google.protobuf.Timestamp", include_str!("docs/wellknown/Timestamp.md")), + ("google.protobuf.Type", include_str!("docs/wellknown/Type.md")), + ("google.protobuf.UInt32Value", include_str!("docs/wellknown/UInt32Value.md")), + ("google.protobuf.UInt64Value", include_str!("docs/wellknown/UInt64Value.md")), + ("google.protobuf.Value", include_str!("docs/wellknown/Value.md")), ]) }); diff --git a/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-3.snap b/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-3.snap index 3694468..ee62fac 100644 --- a/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-3.snap +++ b/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-3.snap @@ -1,6 +1,7 @@ --- source: src/workspace/hover.rs -expression: "state.hover(\"com.workspace\", \"int64\")" +expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::FieldType(\"int64\".to_string()))" +snapshot_kind: text --- kind: markdown -value: "*int64* builtin type, A 64-bit integer (varint encoding)\n---\nValues of this type range between `-9223372036854775808` and `9223372036854775807`.\nBeware that negative values are encoded as ten bytes on the wire!" +value: "*int64* builtin type, A 64-bit integer (varint encoding)\n\n---\nValues of this type range between `-9223372036854775808` and `9223372036854775807`.\nBeware that negative values are encoded as ten bytes on the wire!\n" diff --git a/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover.snap b/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover.snap index 77b0777..1bcf569 100644 --- a/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover.snap +++ b/src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover.snap @@ -1,6 +1,7 @@ --- source: src/workspace/hover.rs -expression: "state.hover(\"com.workspace\", \"google.protobuf.Any\")" +expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::Identifier(\"google.protobuf.Any\".to_string()))" +snapshot_kind: text --- kind: markdown -value: "*google.protobuf.Any* wellknown type\n---\n`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message.\nThe JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL.\n---\n```proto\nmessage Any {\n string type_url = 1; // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message\n bytes value = 2; // Must be a valid serialized protocol buffer\n}\n```\n\n" +value: "*google.protobuf.Any* wellknown type\n---\n`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message.\nThe JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL.\n---\n```proto\nmessage Any {\n string type_url = 1; // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message\n bytes value = 2; // Must be a valid serialized protocol buffer\n}\n```"