Skip to content

Commit 1990e37

Browse files
committed
refactor(internal/lsp): 删除未使用的 LSP 字段定义
1 parent 8944fef commit 1990e37

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

internal/lsp/protocol/enums.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
ResourceOperationKindDelete ResourceOperationKind = "delete"
2424
)
2525

26+
// FailureHandlingKind 定义出错后的处理方式
2627
type FailureHandlingKind string
2728

2829
const (

internal/lsp/protocol/semantic.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,13 @@ type SemanticTokensClientCapabilities struct {
4444
Formats []TokenFormat `json:"formats"`
4545
}
4646

47-
// SemanticTokensRequestFull SemanticTokensClientCapabilities.request.request.full 和 SemanticTokensOptions.Range 字段对应的值
48-
type SemanticTokensRequestFull struct {
49-
// The client will send the `textDocument/semanticTokens/full/delta` request if
50-
// the server provides a corresponding handler.
51-
Delta bool `json:"delta,omitempty"`
52-
}
53-
54-
// SemanticTokensOptions 服务有关 SemanticTokens 的支持情况
47+
// SemanticTokensOptions 服务端有关 SemanticTokens 的支持情况
5548
type SemanticTokensOptions struct {
5649
WorkDoneProgressOptions
5750
// The legend used by the server
5851
Legend SemanticTokensLegend `json:"legend"`
5952

60-
// Server supports providing semantic tokens for a sepcific range of a document.
53+
// Server supports providing semantic tokens for a specific range of a document.
6154
//
6255
// bool | {}
6356
Range interface{} `json:"range,omitempty"`
@@ -76,7 +69,7 @@ type SemanticTokensLegend struct {
7669
TokenModifiers []string `json:"tokenModifiers"`
7770
}
7871

79-
// SemanticTokensParams textDocument/semanticTokens/full 入口参数
72+
// SemanticTokensParams textDocument/semanticTokens 入口参数
8073
type SemanticTokensParams struct {
8174
WorkDoneProgressParams
8275
PartialResultParams
@@ -85,7 +78,7 @@ type SemanticTokensParams struct {
8578
TextDocument TextDocumentIdentifier `json:"textDocument"`
8679
}
8780

88-
// SemanticTokens textDocument/semanticTokens/full 返回参数
81+
// SemanticTokens textDocument/semanticTokens 返回参数
8982
type SemanticTokens struct {
9083
// An optional result id. If provided and clients support delta updating
9184
// the client will include the result id in the next semantic token request.

internal/lsp/protocol/textdocument.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,6 @@ type DidChangeConfigurationClientCapabilities struct {
120120
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
121121
}
122122

123-
// DocumentOnTypeFormattingOptions format document on type options.
124-
type DocumentOnTypeFormattingOptions struct {
125-
// A character on which formatting should be triggered, like `}`.
126-
FirstTriggerCharacter string `json:"firstTriggerCharacter"`
127-
128-
// More trigger characters.
129-
MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"`
130-
}
131-
132123
// RenameOptions Rename options
133124
type RenameOptions struct {
134125
WorkDoneProgressOptions
@@ -195,20 +186,12 @@ type DocumentFilter struct {
195186
Pattern string `json:"pattern,omitempty"`
196187
}
197188

198-
// DidSaveTextDocumentParams textDocument/didSave 的参数
199-
type DidSaveTextDocumentParams struct {
200-
// The document that was saved.
201-
TextDocument TextDocumentIdentifier `json:"textDocument"`
202-
203-
// Optional the content when saved. Depends on the includeText value
204-
// when the save notification was requested.
205-
Text string `json:"text,omitempty"`
206-
}
207-
189+
// DocumentRangeFormattingOptions textDocument/rangeFormatting 服务端返回的参数
208190
type DocumentRangeFormattingOptions struct {
209191
WorkDoneProgressOptions
210192
}
211193

194+
// SelectionRangeOptions textDocument/selectionRange 服务端返回的参数
212195
type SelectionRangeOptions struct {
213196
WorkDoneProgressOptions
214197
}

0 commit comments

Comments
 (0)