Skip to content

Commit 2e42750

Browse files
authored
chore: move hover docs to separate markdown files (#78)
1 parent 76f84b3 commit 2e42750

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+473
-575
lines changed

src/workspace/docs/builtin/bool.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*bool* builtin type, A Boolean value: `true` or `false`.
2+
3+
---
4+
Encoded as a single byte: `0x00` or `0xff` (all non-zero bytes decode to `true`)

src/workspace/docs/builtin/bytes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*bytes* builtin type, A blob of arbitrary bytes.
2+
3+
---
4+
Stores at most 4GB of binary data. Encoded as base64 in JSON.
5+

src/workspace/docs/builtin/default.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*default* builtin type, A magic option that specifies the field's default value.
2+
3+
---
4+
5+
Unlike every other option on a field, this does not have a corresponding field in
6+
`google.protobuf.FieldOptions`; it is implemented by compiler magic.
7+

src/workspace/docs/builtin/double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*double* builtin type,
2+
3+
---
4+
A double-precision floating point number (IEEE-745.2008 binary64).
5+

src/workspace/docs/builtin/fixed32.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*fixed32* builtin type, A 32-bit unsigned integer (4-byte encoding)
2+
3+
---
4+
Values of this type range between `0` and `4294967295`.
5+

src/workspace/docs/builtin/fixed64.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*fixed64* builtin type, A 64-bit unsigned integer (8-byte encoding)
2+
3+
---
4+
Values of this type range between `0` and `18446744073709551615`.
5+

src/workspace/docs/builtin/float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*float* builtin type
2+
3+
---
4+
A single-precision floating point number (IEEE-745.2008 binary32).
5+

src/workspace/docs/builtin/int32.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*int32* builtin type, A 32-bit integer (varint encoding)
2+
3+
---
4+
Values of this type range between `-2147483648` and `2147483647`.
5+
Beware that negative values are encoded as five bytes on the wire!

src/workspace/docs/builtin/int64.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*int64* builtin type, A 64-bit integer (varint encoding)
2+
3+
---
4+
Values of this type range between `-9223372036854775808` and `9223372036854775807`.
5+
Beware that negative values are encoded as ten bytes on the wire!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*sfixed32* builtin type, A 32-bit integer (4-byte encoding)
2+
3+
---
4+
Values of this type range between `-2147483648` and `2147483647`.
5+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*sfixed64* builtin type, A 64-bit integer (8-byte encoding)
2+
3+
---
4+
Values of this type range between `-9223372036854775808` and `9223372036854775807`.

src/workspace/docs/builtin/sint32.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*sint32* builtin type, A 32-bit integer (ZigZag encoding)
2+
3+
---
4+
Values of this type range between `-2147483648` and `2147483647`.
5+

src/workspace/docs/builtin/sint64.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*sint64* builtin type, A 64-bit integer (ZigZag encoding)
2+
3+
---
4+
Values of this type range between `-9223372036854775808` and `9223372036854775807`.
5+

src/workspace/docs/builtin/string.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*string* builtin type, A string of text.
2+
3+
---
4+
Stores at most 4GB of text. Intended to be UTF-8 encoded Unicode; use `bytes` if you need other encodings.

src/workspace/docs/builtin/uint32.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*uint32* builtin type, A 32-bit unsigned integer (varint encoding)
2+
3+
---
4+
Values of this type range between `0` and `4294967295`.
5+

src/workspace/docs/builtin/uint64.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*uint64* builtin type, A 64-bit unsigned integer (varint encoding)
2+
3+
---
4+
Values of this type range between `0` and `18446744073709551615`.
5+

src/workspace/docs/wellknown/Any.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*google.protobuf.Any* wellknown type
2+
---
3+
`Any` contains an arbitrary serialized message along with a URL that describes the type of the serialized message.
4+
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.
5+
---
6+
```proto
7+
message Any {
8+
string type_url = 1; // A URL/resource name that uniquely identifies the type of the serialized protocol buffer message
9+
bytes value = 2; // Must be a valid serialized protocol buffer
10+
}
11+
```

src/workspace/docs/wellknown/Api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*google.protobuf.Api* well known type
2+
---
3+
`Api` is a light-weight descriptor for a protocol buffer service.
4+
---
5+
```proto
6+
message Api {
7+
string name = 1; // The fully qualified name of this api, including package name followed by the api's simple name
8+
repeated Method methods = 2; // The methods of this api, in unspecified order
9+
repeated Option options = 3; // Any metadata attached to the API
10+
string version = 4; // A version string fo this interface
11+
SourceContext source_context = 5; // Source context for the protocol buffer service
12+
repeated Mixin mixins = 6; // Included interfaces
13+
Syntax syntax = 7; // Source syntax of the service
14+
}
15+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.BoolValue* well known type, Wrapper message for bool
2+
---
3+
The JSON representation for `BoolValue` is JSON `true` and `false`
4+
---
5+
```proto
6+
message BoolValue {
7+
bool value = 1;
8+
}
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.BytesValue* well known type, Wrapper message for bytes
2+
---
3+
The JSON representation for `BytesValue` is JSON string.
4+
---
5+
```proto
6+
message BytesValue {
7+
bytes value = 1;
8+
}
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.DoubleValue* well known type, Wrapper message for `double`
2+
---
3+
The JSON representation for `DoubleValue` is JSON number.
4+
---
5+
```proto
6+
message DoubleValue {
7+
double value = 1;
8+
}
9+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*google.protobuf.Duration* well known type
2+
---
3+
A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
4+
It is independent of any calendar and concepts like "day" or "month".
5+
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.
6+
Range is approximately +-10,000 years.
7+
---
8+
```proto
9+
message Duration {
10+
int64 seconds = 1; // Signed seconds of the span of time Must be from -315,576,000,000 to +315,576,000,000 inclusive
11+
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.
12+
}
13+
```

src/workspace/docs/wellknown/Empty.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*google.protobuf.Empty* well known type
2+
---
3+
A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs.
4+
The JSON representation for Empty is empty JSON object `{}`

src/workspace/docs/wellknown/Enum.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*google.protobuf.Enum* well known type
2+
---
3+
Enum type definition
4+
---
5+
```proto
6+
message Enum {
7+
string name = 1; // Enum type name.
8+
repeated EnumValue enumvalue = 2; // Enum value definitions.
9+
repeated Option options = 3; // Protocol buffer options.
10+
SourceContext source_context = 4; // The source context.
11+
Syntax syntax = 5; // The source syntax.
12+
string edition = 6; // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
13+
}
14+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*google.protobuf.EnumValue* well known type
2+
---
3+
Enum value definition
4+
---
5+
```proto
6+
message EnumValue {
7+
string name = 1; // Enum value name.
8+
int32 number = 2; // Enum value number.
9+
repeated Option options = 3; // Protocol buffer options.
10+
}
11+
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*google.protobuf.Field.Cardinality* well known type
2+
---
3+
Whether a field is optional, required, or repeated.
4+
---
5+
```proto
6+
enum Cardinality {
7+
CARDINALITY_UNKNOWN = 0; // For fields with unknown cardinality.
8+
CARDINALITY_OPTIONAL = 1; // For optional fields.
9+
CARDINALITY_REQUIRED = 2; // For required fields. Proto2 syntax only.
10+
CARDINALITY_REPEATED = 3; // For repeated fields.
11+
}
12+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
*google.protobuf.Field.Kind* well known type
2+
---
3+
Basic field types.
4+
---
5+
```proto
6+
enum Kind {
7+
TYPE_UNKNOWN = 0; // Field type unknown.
8+
TYPE_DOUBLE = 1; // Field type double.
9+
TYPE_FLOAT = 2; // Field type float.
10+
TYPE_INT64 = 3; // Field type int64.
11+
TYPE_UINT64 = 4; // Field type uint64.
12+
TYPE_INT32 = 5; // Field type int32.
13+
TYPE_FIXED64 = 6; // Field type fixed64.
14+
TYPE_FIXED32 = 7; // Field type fixed32.
15+
TYPE_BOOL = 8; // Field type bool.
16+
TYPE_STRING = 9; // Field type string.
17+
TYPE_GROUP = 10; // Field type group. Proto2 syntax only, and deprecated.
18+
TYPE_MESSAGE = 11; // Field type message.
19+
TYPE_BYTES = 12; // Field type bytes.
20+
TYPE_UINT32 = 13; // Field type uint32.
21+
TYPE_ENUM = 14; // Field type enum.
22+
TYPE_SFIXED32 = 15; // Field type sfixed32.
23+
TYPE_SFIXED64 = 16; // Field type sfixed64.
24+
TYPE_SINT32 = 17; // Field type sint32.
25+
TYPE_SINT64 = 18; // Field type sint64.
26+
}
27+
```

src/workspace/docs/wellknown/Field.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*google.protobuf.Field* well known type
2+
---
3+
A single field of a message type.
4+
---
5+
```proto
6+
message Field {
7+
Kind kind = 1; // The field type.
8+
Cardinality cardinality = 2; // The field cardinality.
9+
int32 number = 3; // The field number.
10+
string name = 4; // The field name.
11+
string type_url = 6; // The field type URL, without the scheme, for message or enumeration types
12+
int32 oneof_index = 7; // The index of the field type in `Type.oneofs`, for message or enumeration types.
13+
bool packed = 8; // Whether to use alternative packed wire representation.
14+
repeated Option options = 9; // The protocol buffer options.
15+
string json_name = 10; // The field JSON name.
16+
string default_value = 11; // The string value of the default value of this field. Proto2 syntax only.
17+
}
18+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.FieldMask* well known type
2+
---
3+
`FieldMask` represents a set of symbolic field paths
4+
---
5+
```proto
6+
message FieldMask {
7+
repeated string paths = 1; // The set of field mask paths.
8+
}
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.FloatValue* well known type, Wrapper message for `float`
2+
---
3+
The JSON representation for `FloatValue` is JSON number.
4+
---
5+
```proto
6+
message FloatValue {
7+
float value = 1;
8+
}
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.Int32Value* well known type, Wrapper message for `int32`
2+
---
3+
The JSON representation for `Int32Value` is JSON number.
4+
---
5+
```proto
6+
message Int32Value {
7+
int32 value = 1;
8+
}
9+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.Int64Value* well known type, Wrapper message for `int64`
2+
---
3+
The JSON representation for `Int64Value` is JSON string
4+
---
5+
```proto
6+
message Int64Value {
7+
int64 value = 1;
8+
}
9+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*google.protobuf.ListValue* well known type
2+
---
3+
`ListValue` is a wrapper around a repeated field of values.
4+
The JSON representation for `ListValue` is JSON array.
5+
---
6+
```proto
7+
message ListValue {
8+
repeated Value values = 1; // Repeated field of dynamically typed values.
9+
}
10+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*google.protobuf.Method* well known type
2+
---
3+
Method represents a method of an API interface.
4+
---
5+
```proto
6+
message Method {
7+
string name = 1; // The simple name of this method.
8+
string request_type_url = 2; // A URL of the input message type.
9+
bool request_streaming = 3; // If true, the request is streamed.
10+
string response_type_url = 4; // The URL of the output message type.
11+
bool response_streaming = 5; // If true, the response is streamed.
12+
repeated Option options = 6; // Any metadata attached to the method.
13+
Syntax syntax = 7; // The source syntax of this method.
14+
}
15+
```

src/workspace/docs/wellknown/Mixin.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*google.protobuf.Mixin* well known type
2+
---
3+
Declares an API Interface to be included in this interface.
4+
---
5+
```proto
6+
message Mixin {
7+
string name = 1; // The fully qualified name of the interface which is included.
8+
string root = 2; // If non-empty specifies a path under which the interface is served.
9+
}
10+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*google.protobuf.NullValue* well known type
2+
---
3+
`NullValue` is a singleton enumeration to represent the null value for the `Value` type union.
4+
The JSON representation for `NullValue` is JSON `null`.
5+
---
6+
```proto
7+
enum NullValue {
8+
NULL_VALUE = 0; // Null value.
9+
}
10+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*google.protobuf.Option* well known type
2+
---
3+
A protocol buffer option, which can be attached to a message, field, enumeration, etc.
4+
---
5+
```proto
6+
message Option {
7+
string name = 1; // The option's name. For example, "java_package".
8+
Any value = 2; // The option's value. For example, "com.google.protobuf".
9+
}
10+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*google.protobuf.SourceContext* well known type
2+
---
3+
`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined.
4+
---
5+
```proto
6+
message SourceContext {
7+
string file_name = 1; // The path-qualified name of the .proto file that contained the associated protobuf element.
8+
}
9+
```

0 commit comments

Comments
 (0)