Skip to content

Commit 4acd140

Browse files
committed
all: fix documentations
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
1 parent ebf1de5 commit 4acd140

10 files changed

+64
-55
lines changed

basic.go

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,6 @@ type LocationLink struct {
9797
TargetSelectionRange Range `json:"targetSelectionRange"`
9898
}
9999

100-
// CodeDescription is the structure to capture a description for an error code.
101-
//
102-
// @since 3.16.0.
103-
type CodeDescription struct {
104-
// Href an URI to open with more information about the diagnostic error.
105-
Href URI `json:"href"`
106-
}
107-
108100
// Command represents a reference to a command. Provides a title which will be used to represent a command in the UI.
109101
//
110102
// Commands are identified by a string identifier.
@@ -649,17 +641,17 @@ type DocumentFilter struct {
649641
//
650642
// Glob patterns can have the following syntax:
651643
// "*"
652-
// to match one or more characters in a path segment
644+
// "*" to match one or more characters in a path segment
653645
// "?"
654-
// to match on one character in a path segment
646+
// "?" to match on one character in a path segment
655647
// "**"
656-
// to match any number of path segments, including none
648+
// "**" to match any number of path segments, including none
657649
// "{}"
658-
// to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
650+
// "{}" to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
659651
// "[]"
660-
// to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
652+
// "[]" to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
661653
// "[!...]"
662-
// to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
654+
// "[!...]" to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
663655
Pattern string `json:"pattern,omitempty"`
664656
}
665657

callhierarchy.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ package protocol
77
//
88
// @since 3.16.0.
99
type CallHierarchy struct {
10-
// DynamicRegistration whether implementation supports dynamic registration. If this is set to "true"
11-
// the client supports the new TextDocumentRegistrationOptions && StaticRegistrationOptions
12-
// return value for the corresponding server capability as well.
10+
// DynamicRegistration whether implementation supports dynamic registration.
11+
//
12+
// If this is set to "true" the client supports the new
13+
// TextDocumentRegistrationOptions && StaticRegistrationOptions return
14+
// value for the corresponding server capability as well.
1315
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
1416
}
1517

diagnostics.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ func (d DiagnosticSeverity) String() string {
8383
}
8484
}
8585

86+
// CodeDescription is the structure to capture a description for an error code.
87+
//
88+
// @since 3.16.0.
89+
type CodeDescription struct {
90+
// Href an URI to open with more information about the diagnostic error.
91+
Href URI `json:"href"`
92+
}
93+
8694
// DiagnosticTag is the diagnostic tags.
8795
//
8896
// @since 3.15.0.
@@ -126,7 +134,7 @@ type DiagnosticRelatedInformation struct {
126134
Message string `json:"message"`
127135
}
128136

129-
// PublishDiagnosticsParams represents a params of PublishDiagnostics Notification.
137+
// PublishDiagnosticsParams represents a params of PublishDiagnostics notification.
130138
type PublishDiagnosticsParams struct {
131139
// URI is the URI for which diagnostic information is reported.
132140
URI DocumentURI `json:"uri"`

general.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type ClientInfo struct {
2929
Version string `json:"version,omitempty"`
3030
}
3131

32-
// InitializeParams params of Initialize Request.
32+
// InitializeParams params of Initialize request.
3333
type InitializeParams struct {
3434
WorkDoneProgressParams
3535

@@ -232,7 +232,7 @@ type FileDelete struct {
232232
URI string `json:"uri"`
233233
}
234234

235-
// DocumentHighlightParams params of DocumentHighlight Request.
235+
// DocumentHighlightParams params of DocumentHighlight request.
236236
//
237237
// @since 3.15.0.
238238
type DocumentHighlightParams struct {
@@ -241,7 +241,7 @@ type DocumentHighlightParams struct {
241241
PartialResultParams
242242
}
243243

244-
// DeclarationParams params of Declaration Request.
244+
// DeclarationParams params of Declaration request.
245245
//
246246
// @since 3.15.0.
247247
type DeclarationParams struct {
@@ -250,7 +250,7 @@ type DeclarationParams struct {
250250
PartialResultParams
251251
}
252252

253-
// DefinitionParams params of Definition Request.
253+
// DefinitionParams params of Definition request.
254254
//
255255
// @since 3.15.0.
256256
type DefinitionParams struct {
@@ -259,7 +259,7 @@ type DefinitionParams struct {
259259
PartialResultParams
260260
}
261261

262-
// TypeDefinitionParams params of TypeDefinition Request.
262+
// TypeDefinitionParams params of TypeDefinition request.
263263
//
264264
// @since 3.15.0.
265265
type TypeDefinitionParams struct {
@@ -268,7 +268,7 @@ type TypeDefinitionParams struct {
268268
PartialResultParams
269269
}
270270

271-
// ImplementationParams params of Implementation Request.
271+
// ImplementationParams params of Implementation request.
272272
//
273273
// @since 3.15.0.
274274
type ImplementationParams struct {
@@ -454,7 +454,7 @@ type DocumentLinkRegistrationOptions struct {
454454
ResolveProvider bool `json:"resolveProvider,omitempty"`
455455
}
456456

457-
// InitializedParams params of Initialized Notification.
457+
// InitializedParams params of Initialized notification.
458458
type InitializedParams struct{}
459459

460460
// WorkspaceFolders represents a slice of WorkspaceFolder.

language.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strconv"
88
)
99

10-
// CompletionParams params of Completion Request.
10+
// CompletionParams params of Completion request.
1111
type CompletionParams struct {
1212
TextDocumentPositionParams
1313
WorkDoneProgressParams
@@ -422,7 +422,7 @@ type CompletionRegistrationOptions struct {
422422
ResolveProvider bool `json:"resolveProvider,omitempty"`
423423
}
424424

425-
// HoverParams params of Hover Request.
425+
// HoverParams params of Hover request.
426426
//
427427
// @since 3.15.0.
428428
type HoverParams struct {
@@ -440,7 +440,7 @@ type Hover struct {
440440
Range *Range `json:"range,omitempty"`
441441
}
442442

443-
// SignatureHelpParams params of SignatureHelp Request.
443+
// SignatureHelpParams params of SignatureHelp request.
444444
//
445445
// @since 3.15.0.
446446
type SignatureHelpParams struct {
@@ -596,7 +596,7 @@ type SignatureHelpRegistrationOptions struct {
596596
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
597597
}
598598

599-
// ReferenceParams params of References Request.
599+
// ReferenceParams params of References request.
600600
//
601601
// @since 3.15.0.
602602
type ReferenceParams struct {
@@ -653,7 +653,7 @@ func (k DocumentHighlightKind) String() string {
653653
}
654654
}
655655

656-
// DocumentSymbolParams params of Document Symbols Request.
656+
// DocumentSymbolParams params of Document Symbols request.
657657
type DocumentSymbolParams struct {
658658
WorkDoneProgressParams
659659
PartialResultParams
@@ -1037,7 +1037,7 @@ type CodeActionRegistrationOptions struct {
10371037
CodeActionOptions
10381038
}
10391039

1040-
// CodeLensParams params of Code Lens Request.
1040+
// CodeLensParams params of Code Lens request.
10411041
type CodeLensParams struct {
10421042
WorkDoneProgressParams
10431043
PartialResultParams
@@ -1071,7 +1071,7 @@ type CodeLensRegistrationOptions struct {
10711071
ResolveProvider bool `json:"resolveProvider,omitempty"`
10721072
}
10731073

1074-
// DocumentLinkParams params of Document Link Request.
1074+
// DocumentLinkParams params of Document Link request.
10751075
type DocumentLinkParams struct {
10761076
WorkDoneProgressParams
10771077
PartialResultParams
@@ -1103,7 +1103,7 @@ type DocumentLink struct {
11031103
Data interface{} `json:"data,omitempty"`
11041104
}
11051105

1106-
// DocumentColorParams params of Document Color Request.
1106+
// DocumentColorParams params of Document Color request.
11071107
type DocumentColorParams struct {
11081108
WorkDoneProgressParams
11091109
PartialResultParams
@@ -1112,7 +1112,7 @@ type DocumentColorParams struct {
11121112
TextDocument TextDocumentIdentifier `json:"textDocument"`
11131113
}
11141114

1115-
// ColorInformation response of Document Color Request.
1115+
// ColorInformation response of Document Color request.
11161116
type ColorInformation struct {
11171117
// Range is the range in the document where this color appears.
11181118
Range Range `json:"range"`
@@ -1136,7 +1136,7 @@ type Color struct {
11361136
Red float64 `json:"red"`
11371137
}
11381138

1139-
// ColorPresentationParams params of Color Presentation Request.
1139+
// ColorPresentationParams params of Color Presentation request.
11401140
type ColorPresentationParams struct {
11411141
WorkDoneProgressParams
11421142
PartialResultParams
@@ -1151,7 +1151,7 @@ type ColorPresentationParams struct {
11511151
Range Range `json:"range"`
11521152
}
11531153

1154-
// ColorPresentation response of Color Presentation Request.
1154+
// ColorPresentation response of Color Presentation request.
11551155
type ColorPresentation struct {
11561156
// Label is the label of this color presentation. It will be shown on the color
11571157
// picker header. By default this is also the text that is inserted when selecting
@@ -1167,7 +1167,7 @@ type ColorPresentation struct {
11671167
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
11681168
}
11691169

1170-
// DocumentFormattingParams params of Document Formatting Request.
1170+
// DocumentFormattingParams params of Document Formatting request.
11711171
type DocumentFormattingParams struct {
11721172
WorkDoneProgressParams
11731173

@@ -1205,7 +1205,7 @@ type FormattingOptions struct {
12051205
Key map[string]interface{} `json:"key,omitempty"` // bool | int32 | string
12061206
}
12071207

1208-
// DocumentRangeFormattingParams params of Document Range Formatting Request.
1208+
// DocumentRangeFormattingParams params of Document Range Formatting request.
12091209
type DocumentRangeFormattingParams struct {
12101210
WorkDoneProgressParams
12111211

@@ -1219,7 +1219,7 @@ type DocumentRangeFormattingParams struct {
12191219
Options FormattingOptions `json:"options"`
12201220
}
12211221

1222-
// DocumentOnTypeFormattingParams params of Document on Type Formatting Request.
1222+
// DocumentOnTypeFormattingParams params of Document on Type Formatting request.
12231223
type DocumentOnTypeFormattingParams struct {
12241224
// TextDocument is the document to format.
12251225
TextDocument TextDocumentIdentifier `json:"textDocument"`
@@ -1245,7 +1245,7 @@ type DocumentOnTypeFormattingRegistrationOptions struct {
12451245
MoreTriggerCharacter []string `json:"moreTriggerCharacter"`
12461246
}
12471247

1248-
// RenameParams params of Rename Request.
1248+
// RenameParams params of Rename request.
12491249
type RenameParams struct {
12501250
TextDocumentPositionParams
12511251
PartialResultParams
@@ -1271,7 +1271,7 @@ type PrepareRenameParams struct {
12711271
TextDocumentPositionParams
12721272
}
12731273

1274-
// FoldingRangeParams params of Folding Range Request.
1274+
// FoldingRangeParams params of Folding Range request.
12751275
type FoldingRangeParams struct {
12761276
TextDocumentPositionParams
12771277
PartialResultParams

progress.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ type WorkDoneProgressKind string
1010

1111
// list of WorkDoneProgressKind.
1212
const (
13-
WorkDoneProgressKindBegin WorkDoneProgressKind = "begin"
13+
// WorkDoneProgressKindBegin kind of WorkDoneProgressBegin.
14+
WorkDoneProgressKindBegin WorkDoneProgressKind = "begin"
15+
16+
// WorkDoneProgressKindReport kind of WorkDoneProgressReport.
1417
WorkDoneProgressKindReport WorkDoneProgressKind = "report"
15-
WorkDoneProgressKindEnd WorkDoneProgressKind = "end"
18+
19+
// WorkDoneProgressKindEnd kind of WorkDoneProgressEnd.
20+
WorkDoneProgressKindEnd WorkDoneProgressKind = "end"
1621
)
1722

1823
// WorkDoneProgressBegin is the to start progress reporting a "$/progress" notification.

semantic_token.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package protocol
88
// @since 3.16.0.
99
type SemanticTokenTypes string
1010

11+
// list of SemanticTokenTypes.
1112
const (
1213
SemanticTokenNamespace SemanticTokenTypes = "namespace"
1314

@@ -41,6 +42,7 @@ const (
4142
// @since 3.16.0.
4243
type SemanticTokenModifiers string
4344

45+
// list of SemanticTokenModifiers.
4446
const (
4547
SemanticTokenModifierDeclaration SemanticTokenModifiers = "declaration"
4648
SemanticTokenModifierDefinition SemanticTokenModifiers = "definition"

text.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"strconv"
88
)
99

10-
// DidOpenTextDocumentParams params of DidOpenTextDocument Notification.
10+
// DidOpenTextDocumentParams params of DidOpenTextDocument notification.
1111
type DidOpenTextDocumentParams struct {
1212
// TextDocument is the document that was opened.
1313
TextDocument TextDocumentItem `json:"textDocument"`
1414
}
1515

16-
// DidChangeTextDocumentParams params of DidChangeTextDocument Notification.
16+
// DidChangeTextDocumentParams params of DidChangeTextDocument notification.
1717
type DidChangeTextDocumentParams struct {
1818
// TextDocument is the document that did change. The version number points
1919
// to the version after all provided content changes have
@@ -73,7 +73,7 @@ type WillSaveTextDocumentParams struct {
7373
Reason TextDocumentSaveReason `json:"reason,omitempty"`
7474
}
7575

76-
// DidSaveTextDocumentParams params of DidSaveTextDocument Notification.
76+
// DidSaveTextDocumentParams params of DidSaveTextDocument notification.
7777
type DidSaveTextDocumentParams struct {
7878
// Text optional the content when saved. Depends on the includeText value
7979
// when the save notification was requested.
@@ -104,7 +104,7 @@ type TextDocumentSaveRegistrationOptions struct {
104104
IncludeText bool `json:"includeText,omitempty"`
105105
}
106106

107-
// DidCloseTextDocumentParams params of DidCloseTextDocument Notification.
107+
// DidCloseTextDocumentParams params of DidCloseTextDocument notification.
108108
type DidCloseTextDocumentParams struct {
109109
// TextDocument the document that was closed.
110110
TextDocument TextDocumentIdentifier `json:"textDocument"`

window.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package protocol
55

66
import "strconv"
77

8-
// ShowMessageParams params of ShowMessage Notification.
8+
// ShowMessageParams params of ShowMessage notification.
99
type ShowMessageParams struct {
1010
// Message is the actual message.
1111
Message string `json:"message"`
@@ -67,7 +67,7 @@ func ToMessageType(level string) MessageType {
6767
return mt
6868
}
6969

70-
// ShowMessageRequestParams params of ShowMessage Request.
70+
// ShowMessageRequestParams params of ShowMessage request.
7171
type ShowMessageRequestParams struct {
7272
// Actions is the message action items to present.
7373
Actions []MessageActionItem `json:"actions"`
@@ -85,7 +85,7 @@ type MessageActionItem struct {
8585
Title string `json:"title"`
8686
}
8787

88-
// LogMessageParams params of LogMessage Notification.
88+
// LogMessageParams params of LogMessage notification.
8989
type LogMessageParams struct {
9090
// Message is the actual message
9191
Message string `json:"message"`

0 commit comments

Comments
 (0)