Skip to content

Commit

Permalink
refactor(internal/lsp): 删除未使用的 LSP 字段定义
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Jul 29, 2020
1 parent 8944fef commit 1990e37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
1 change: 1 addition & 0 deletions internal/lsp/protocol/enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
ResourceOperationKindDelete ResourceOperationKind = "delete"
)

// FailureHandlingKind 定义出错后的处理方式
type FailureHandlingKind string

const (
Expand Down
15 changes: 4 additions & 11 deletions internal/lsp/protocol/semantic.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,13 @@ type SemanticTokensClientCapabilities struct {
Formats []TokenFormat `json:"formats"`
}

// SemanticTokensRequestFull SemanticTokensClientCapabilities.request.request.full 和 SemanticTokensOptions.Range 字段对应的值
type SemanticTokensRequestFull struct {
// The client will send the `textDocument/semanticTokens/full/delta` request if
// the server provides a corresponding handler.
Delta bool `json:"delta,omitempty"`
}

// SemanticTokensOptions 服务有关 SemanticTokens 的支持情况
// SemanticTokensOptions 服务端有关 SemanticTokens 的支持情况
type SemanticTokensOptions struct {
WorkDoneProgressOptions
// The legend used by the server
Legend SemanticTokensLegend `json:"legend"`

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

// SemanticTokensParams textDocument/semanticTokens/full 入口参数
// SemanticTokensParams textDocument/semanticTokens 入口参数
type SemanticTokensParams struct {
WorkDoneProgressParams
PartialResultParams
Expand All @@ -85,7 +78,7 @@ type SemanticTokensParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}

// SemanticTokens textDocument/semanticTokens/full 返回参数
// SemanticTokens textDocument/semanticTokens 返回参数
type SemanticTokens struct {
// An optional result id. If provided and clients support delta updating
// the client will include the result id in the next semantic token request.
Expand Down
21 changes: 2 additions & 19 deletions internal/lsp/protocol/textdocument.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@ type DidChangeConfigurationClientCapabilities struct {
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

// DocumentOnTypeFormattingOptions format document on type options.
type DocumentOnTypeFormattingOptions struct {
// A character on which formatting should be triggered, like `}`.
FirstTriggerCharacter string `json:"firstTriggerCharacter"`

// More trigger characters.
MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"`
}

// RenameOptions Rename options
type RenameOptions struct {
WorkDoneProgressOptions
Expand Down Expand Up @@ -195,20 +186,12 @@ type DocumentFilter struct {
Pattern string `json:"pattern,omitempty"`
}

// DidSaveTextDocumentParams textDocument/didSave 的参数
type DidSaveTextDocumentParams struct {
// The document that was saved.
TextDocument TextDocumentIdentifier `json:"textDocument"`

// Optional the content when saved. Depends on the includeText value
// when the save notification was requested.
Text string `json:"text,omitempty"`
}

// DocumentRangeFormattingOptions textDocument/rangeFormatting 服务端返回的参数
type DocumentRangeFormattingOptions struct {
WorkDoneProgressOptions
}

// SelectionRangeOptions textDocument/selectionRange 服务端返回的参数
type SelectionRangeOptions struct {
WorkDoneProgressOptions
}
Expand Down

0 comments on commit 1990e37

Please sign in to comment.