lsp

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculatePos

func CalculatePos(fset *token.FileSet, path string, line int, char int) token.Pos

line and char must be zero-based

func ParseDocumentUri

func ParseDocumentUri(uri string) *url.URL

func ParseMessage

func ParseMessage(buf []byte) (map[string]interface{}, bool)

func ParseRequest

func ParseRequest(buf []byte, req interface{}) bool

func ReadBuffer

func ReadBuffer(reader *bufio.Reader) ([]byte, bool)

func SendError

func SendError(format string, args ...interface{})

func SendErrors

func SendErrors(errs []error)

func SendMessage

func SendMessage(res interface{}) bool

Types

type ClientCapabilities

type ClientCapabilities struct {
	Workspace WorkspaceClientCapabilities `json:"workspace"`
}

type CodeLens

type CodeLens struct {
	Range   Range   `json:"range"`
	Command Command `json:"command"`
}

type CodeLensParams

type CodeLensParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type CodeLensRequest

type CodeLensRequest struct {
	Jsonrpc string         `json:"jsonrpc"`
	Id      int            `json:"id"`
	Method  string         `json:"method"`
	Params  CodeLensParams `json:"Params"`
}

type CodeLensResponse

type CodeLensResponse struct {
	Jsonrpc string     `json:"jsonrpc"`
	Id      int        `json:"id"`
	Result  []CodeLens `json:"result"`
}

type Command

type Command struct {
	Title     string        `json:"title"`
	Command   string        `json:"command"`
	Arguments []interface{} `json:"arguments"`
}

type Diagnostic

type Diagnostic struct {
	Range   Range  `json:"range"`
	Message string `json:"message"`
}

type InitializeParams

type InitializeParams struct {
	Capabilities ClientCapabilities `json:"capabilities"`
}

type InitializeRequest

type InitializeRequest struct {
	Jsonrpc string           `json:"jsonrpc"`
	Id      int              `json:"id"`
	Method  string           `json:"method"`
	Params  InitializeParams `json:"params"`
}

type InitializeResponse

type InitializeResponse struct {
	Jsonrpc string            `json:"jsonrpc"`
	Id      int               `json:"id"`
	Result  *InitializeResult `json:"result"`
}

type InitializeResult

type InitializeResult struct {
	Capabilities ServerCapabilities `json:"capabilities"`
}

type Location

type Location struct {
	Uri   string `json:"uri"`
	Range Range  `json:"range"`
}

type MarkupContent

type MarkupContent struct {
	Kind  string `json:"kind"`
	Value string `json:"value"`
}

type Position

type Position struct {
	Line      int `json:"line"`
	Character int `json:"character"`
}

type PublishDiagnosticsNotification

type PublishDiagnosticsNotification struct {
	Jsonrpc string                   `json:"jsonrpc"`
	Method  string                   `json:"method"`
	Params  PublishDiagnosticsParams `json:"params"`
}

type PublishDiagnosticsParams

type PublishDiagnosticsParams struct {
	Uri         string       `json:"uri"`
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type Range

type Range struct {
	Start Position `json:"start"`
	End   Position `json:"end"`
}

type ServerCapabilities

type ServerCapabilities struct {
	TextDocumentSync int                         `json:"textDocumentSync"`
	CodeLensProvider bool                        `json:"codeLensProvider"`
	Workspace        WorkspaceServerCapabilities `json:"workspace"`
}

type ShutdownRequest

type ShutdownRequest struct {
	Jsonrpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
}

type ShutdownResponse

type ShutdownResponse struct {
	Jsonrpc string      `json:"jsonrpc"`
	Id      int         `json:"id"`
	Result  interface{} `json:"result"`
}

type TextDocumentIdentifier

type TextDocumentIdentifier struct {
	Uri string `json:"uri"`
}

type TextDocumentNotification added in v0.1.6

type TextDocumentNotification struct {
	Jsonrpc string             `json:"jsonrpc"`
	Method  string             `json:"method"`
	Params  TextDocumentParams `json:"params"`
}

type TextDocumentParams added in v0.1.6

type TextDocumentParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type WorkspaceClientCapabilities

type WorkspaceClientCapabilities struct {
	WorkspaceFolders bool `json:"workspaceFolders"`
}

type WorkspaceFoldersServerCapabilities

type WorkspaceFoldersServerCapabilities struct {
	Supported bool `json:"supported"`
}

type WorkspaceServerCapabilities

type WorkspaceServerCapabilities struct {
	WorkspaceFolders WorkspaceFoldersServerCapabilities `json:"workspaceFolders"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL