lsptypes

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package lsptypes contains the types for the LSP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeType

type ChangeType int

ChangeType represents the change type.

const (
	ChangeTypeNone ChangeType = iota
	ChangeTypeFull
	ChangeTypeIncremental
)

ChangeTypeFull represents the full change type. For more information, see the specification:

type CompletionProvider

type CompletionProvider struct {
	TriggerCharacters []string `json:"triggerCharacters"`
}

CompletionProvider represents the completion provider capabilities.

type ContentChange

type ContentChange struct {
	Range       *Range `json:"range"`
	RangeLength int    `json:"rangeLength"`
	Text        string `json:"text"`
}

ContentChange represents a content change.

type DidChangeParams

type DidChangeParams struct {
	ContentChanges []ContentChange  `json:"contentChanges"`
	TextDocument   TextDocumentItem `json:"textDocument"`
}

DidChangeParams represents the parameters for a didChange request.

type DidCloseParams

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

DidCloseParams represents the parameters for a didClose request.

type DidOpenParams

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

DidOpenParams represents the parameters for a didOpen request.

type Document

type Document struct {
	Text        string `json:"text"`
	Version     int    `json:"version"`
	NumLines    int    `json:"numLines"`
	LineLengths []int  `json:"lineLengths"`
}

Document represents a document.

func (*Document) GetLine

func (d *Document) GetLine(line int) (string, error)

GetLine returns the line at the given index.

func (*Document) GetLineLength

func (d *Document) GetLineLength(line int) (int, error)

GetLineLength returns the length of the line at the given index.

func (*Document) PositionToIndex

func (d *Document) PositionToIndex(position Position) (int, error)

PositionToIndex converts a position(line, character) to an index.

type Hover

type Hover struct {
	Contents string `json:"contents"`
	Range    *Range `json:"range,omitempty"`
}

Hover represents the result of a hover request.

type HoverParams

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

HoverParams represents the parameters for a hover request.

type InitializeResult

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

InitializeResult represents the result for the initialize method.

type MarkupContent

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

MarkupContent represents documentation content.

type ParameterInformation

type ParameterInformation struct {
	Label         string         `json:"label"`
	Documentation *MarkupContent `json:"documentation,omitempty"`
}

ParameterInformation represents information about a function parameter.

type Position

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

Position represents a position in a text document.

type Range

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

Range represents a text range in a text document.

type ServerCapabilities

type ServerCapabilities struct {
	TextDocumentSync      TextDocumentSync      `json:"textDocumentSync"`
	DefinitionProvider    bool                  `json:"definitionProvider"`
	CompletionProvider    CompletionProvider    `json:"completionProvider"`
	HoverProvider         bool                  `json:"hoverProvider"`
	SignatureHelpProvider SignatureHelpProvider `json:"signatureHelpProvider"`
}

ServerCapabilities represents the capabilities of the server.

type ServerInfo

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

ServerInfo represents the server information.

type SignatureHelp

type SignatureHelp struct {
	Signatures      []SignatureInformation `json:"signatures"`
	ActiveSignature int                    `json:"activeSignature"`
	ActiveParameter int                    `json:"activeParameter"`
}

SignatureHelp represents the signature help response.

type SignatureHelpParams

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

SignatureHelpParams represents the parameters for a signature help request.

type SignatureHelpProvider

type SignatureHelpProvider struct {
	TriggerCharacters []string `json:"triggerCharacters"`
}

SignatureHelpProvider represents the signature help provider capabilities.

type SignatureInformation

type SignatureInformation struct {
	Label         string                 `json:"label"`
	Documentation *MarkupContent         `json:"documentation,omitempty"`
	Parameters    []ParameterInformation `json:"parameters,omitempty"`
}

SignatureInformation represents information about a function signature.

type TextDocument

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

TextDocument represents a text document.

type TextDocumentIdentifier

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

TextDocumentIdentifier represents a text document identifier.

type TextDocumentItem

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

TextDocumentItem represents a text document item.

type TextDocumentSync

type TextDocumentSync struct {
	OpenClose bool       `json:"openClose"`
	Change    ChangeType `json:"change"`
}

TextDocumentSync represents the text document sync capabilities.

Jump to

Keyboard shortcuts

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