lsp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package lsp implements types and helpers for the Language Server Protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInfo

type ClientInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type CompletionItem

type CompletionItem struct {
	Label         string `json:"label"`
	Detail        string `json:"detail"`
	Documentation string `json:"documentation"`
}

type CompletionParams

type CompletionParams struct {
	TextDocumentPositionParams
}

type CompletionRequest

type CompletionRequest struct {
	Request
	Params CompletionParams `json:"params"`
}

type CompletionResponse

type CompletionResponse struct {
	Response
	Result []CompletionItem `json:"result"`
}

type DefinitionParams

type DefinitionParams struct {
	TextDocumentPositionParams
}

type DefinitionRequest

type DefinitionRequest struct {
	Request
	Params DefinitionParams `json:"params"`
}

type DefinitionResponse

type DefinitionResponse struct {
	Response
	Result Location `json:"result"`
}

type Diagnostic

type Diagnostic struct {
	Range    Range  `json:"range"`
	Severity int    `json:"severity"`
	Source   string `json:"source"`
	Message  string `json:"message"`
}

type DidChangeTextDocumentParmas

type DidChangeTextDocumentParmas struct {
	TextDocument   VersionTextDocumentIdentifier    `json:"textDocument"`
	ContentChanges []TextDocumentContentChangeEvent `json:"contentchanges"`
}

type DidOpenTextDocument

type DidOpenTextDocument struct {
	Notification
	Params DidOpenTextDocumentParams `json:"params"`
}

type DidOpenTextDocumentParams

type DidOpenTextDocumentParams struct {
	TextDocument TextDocumentItem `json:"textDocument"`
}

type HoverParams

type HoverParams struct {
	TextDocumentPositionParams
}

type HoverRequest

type HoverRequest struct {
	Request
	Params HoverParams `json:"params"`
}

type HoverResponse

type HoverResponse struct {
	Response
	Result HoverResult `json:"result"`
}

type HoverResult

type HoverResult struct {
	Contents string `json:"contents"`
}

type InitializeParams

type InitializeParams struct {
	ClientInfo *ClientInfo `json:"clientInfo"`
}

type InitializeRequest

type InitializeRequest struct {
	Request
	Params InitializeParams `json:"params"`
}

type InitializeResponse

type InitializeResponse struct {
	Response
	Result InitializeResult `json:"result"`
}

func NewInitializeResponse

func NewInitializeResponse(id int) InitializeResponse

type InitializeResult

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

type Location

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

type Notification

type Notification struct {
	RPC    string `json:"jsonrpc"`
	Method string `json:"method"`
}

type Position

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

type PublishDiagnosticsNotification

type PublishDiagnosticsNotification struct {
	Notification
	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 Request

type Request struct {
	RPC    string `json:"jsonrpc"`
	ID     int    `json:"id"`
	Method string `json:"method"`
}

type Response

type Response struct {
	RPC string `json:"jsonrpc"`
	ID  *int   `json:"id,omitempty"`
}

type ServerCapabilities

type ServerCapabilities struct {
	TextDocumentSync   int            `json:"textDocumentSync"`
	HoverProvider      bool           `json:"hoverProvider"`
	DefinitionProvider bool           `json:"definitionProvider"`
	CompletionProvider map[string]any `json:"completionProvider"`
}

type ServerInfo

type ServerInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type TextDocumentContentChangeEvent

type TextDocumentContentChangeEvent struct {
	Text string `json:"text"`
}

type TextDocumentDidChangeNotification

type TextDocumentDidChangeNotification struct {
	Notification
	Params DidChangeTextDocumentParmas `json:"params"`
}

type TextDocumentIdentifier

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

type TextDocumentItem

type TextDocumentItem struct {
	URI        string `json:"uri"`
	LanguageID string `json:"languageId"`
	Version    int    `json:"version"`
	Text       string `json:"text"`
}

type TextDocumentPositionParams

type TextDocumentPositionParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Position     Position               `json:"position"`
}

type VersionTextDocumentIdentifier

type VersionTextDocumentIdentifier struct {
	TextDocumentIdentifier
	Version int `json:"version"`
}

Jump to

Keyboard shortcuts

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