Documentation
¶
Index ¶
- Constants
- func BaseMessage(r any) ([]byte, error)
- func DecodeParams[T any](r Request) (*T, error)
- type CancelRequest
- type ClientCapabilities
- type DiagnosticOptions
- type InitializeRequest
- type InitializeResponse
- type MarkupContent
- type Position
- type Range
- type Request
- type Response
- type ResponseError
- type ServerCapabilities
- type TextDocument
- type TextDocumentSyncKind
Constants ¶
View Source
const ( RequestInitialize = "initialize" RequestShutdown = "shutdown" MethodSetTrace = "$/setTrace" // set trace notification: 'off' | 'messages' | 'verbose' MethodTextDocumentDidChange = "textDocument/didChange" MethodTextDocumentDidClose = "textDocument/didClose" MethodTextDocumentDidSave = "textDocument/didSave" MethodTextDocumentHover = "textDocument/hover" )
View Source
const ( NotificationInitialized = "initialized" NotificationExit = "exit" )
View Source
const ( ErrorCodeParseError = -32700 ErrorCodeInvalidRequest = -32600 ErrorCodeMethodNotFound = -32601 ErrorCodeInvalidParams = -32602 ErrorCodeInternalError = -32603 )
View Source
const ( TextDocumentSyncKindNone = iota TextDocumentSyncKindFull TextDocumentSyncKindIncremental )
Variables ¶
This section is empty.
Functions ¶
func DecodeParams ¶
Types ¶
type CancelRequest ¶
type CancelRequest struct {
Id int `json:"id"` // vscode uses int, but the spec says it can be int or string
}
type ClientCapabilities ¶
type ClientCapabilities struct{}
type DiagnosticOptions ¶
type InitializeRequest ¶
type InitializeRequest struct { Capabilities ClientCapabilities `json:"capabilities"` RootPath string `json:"rootPath"` }
Initialize request
type InitializeResponse ¶
type InitializeResponse struct {
Capabilities ServerCapabilities `json:"capabilities"`
}
Initialize response
type MarkupContent ¶
type Request ¶
type Request struct { Version string `json:"jsonrpc"` Id int `json:"id"` // vscode uses int, but the spec says it can be int or string Method string `json:"method"` Params *json.RawMessage `json:"params"` }
type Response ¶
type Response struct { Version string `json:"jsonrpc"` Id int `json:"id"` // vscode uses int, but the spec says it can be int or string or null Result *json.RawMessage `json:"result"` Error *ResponseError `json:"error"` }
func NewEmptyResponse ¶
func NewResponse ¶
func NewResponse(id int, result json.RawMessage) Response
func NewResponseError ¶
func NewResponseError(id int, err ResponseError) Response
type ResponseError ¶
type ServerCapabilities ¶
type ServerCapabilities struct { TextDocumentSync TextDocumentSyncKind `json:"textDocumentSync"` HoverProvider bool `json:"hoverProvider"` DiagnosticProvider DiagnosticOptions `json:"diagnosticProvider"` }
type TextDocument ¶
type TextDocumentSyncKind ¶
type TextDocumentSyncKind int
Click to show internal directories.
Click to hide internal directories.