protocol

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityError   = 1
	SeverityWarning = 2
	SeverityInfo    = 3
	SeverityHint    = 4
)

Variables

View Source
var SymbolKindName = map[int]string{
	1: "File", 2: "Module", 3: "Namespace", 4: "Package", 5: "Class",
	6: "Method", 7: "Property", 8: "Field", 9: "Constructor", 10: "Enum",
	11: "Interface", 12: "Function", 13: "Variable", 14: "Constant",
	15: "String", 16: "Number", 17: "Boolean", 18: "Array", 19: "Object",
	20: "Key", 21: "Null", 22: "EnumMember", 23: "Struct", 24: "Event",
	25: "Operator", 26: "TypeParameter",
}

Functions

func PathFromURI

func PathFromURI(uri string) string

func URIFromPath

func URIFromPath(absPath string) string

Types

type ClientCapabilities

type ClientCapabilities struct {
	TextDocument TextDocumentClientCapabilities `json:"textDocument"`
	Workspace    WorkspaceClientCapabilities    `json:"workspace,omitempty"`
	Window       WindowClientCapabilities       `json:"window,omitempty"`
}

type Diagnostic

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

type DidOpenTextDocumentParams

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

type GenericCapability

type GenericCapability struct {
	DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}

type HoverContents

type HoverContents struct {
	Value string
}

func (*HoverContents) UnmarshalJSON

func (h *HoverContents) UnmarshalJSON(data []byte) error

type HoverResult

type HoverResult struct {
	Contents HoverContents `json:"contents"`
	Range    *Range        `json:"range,omitempty"`
}

type InitializeParams

type InitializeParams struct {
	ProcessID        *int               `json:"processId"`
	RootURI          string             `json:"rootUri"`
	Capabilities     ClientCapabilities `json:"capabilities"`
	WorkspaceFolders []WorkspaceFolder  `json:"workspaceFolders,omitempty"`
}

type InitializeResult

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

type Location

type Location struct {
	URI   string `json:"uri"`
	Range Range  `json:"range"`
}
type LocationLink struct {
	TargetURI            string `json:"targetUri"`
	TargetRange          Range  `json:"targetRange"`
	TargetSelectionRange Range  `json:"targetSelectionRange"`
}

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 ProgressParams

type ProgressParams struct {
	Token json.RawMessage `json:"token"`
	Value json.RawMessage `json:"value"`
}

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 ReferenceContext

type ReferenceContext struct {
	IncludeDeclaration bool `json:"includeDeclaration"`
}

type ReferenceParams

type ReferenceParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Position     Position               `json:"position"`
	Context      ReferenceContext       `json:"context"`
}

type ServerCapabilities

type ServerCapabilities struct {
	DefinitionProvider     any `json:"definitionProvider,omitempty"`
	ReferencesProvider     any `json:"referencesProvider,omitempty"`
	HoverProvider          any `json:"hoverProvider,omitempty"`
	ImplementationProvider any `json:"implementationProvider,omitempty"`
	DiagnosticProvider     any `json:"diagnosticProvider,omitempty"`
}

type SymbolInformation

type SymbolInformation struct {
	Name     string   `json:"name"`
	Kind     int      `json:"kind"`
	Location Location `json:"location"`
}

type TextDocumentClientCapabilities

type TextDocumentClientCapabilities struct {
	Definition         GenericCapability `json:"definition,omitempty"`
	References         GenericCapability `json:"references,omitempty"`
	Hover              GenericCapability `json:"hover,omitempty"`
	Implementation     GenericCapability `json:"implementation,omitempty"`
	PublishDiagnostics struct {
		RelatedInformation bool `json:"relatedInformation,omitempty"`
	} `json:"publishDiagnostics,omitempty"`
}

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 WindowClientCapabilities

type WindowClientCapabilities struct {
	WorkDoneProgress bool `json:"workDoneProgress"`
}

type WorkDoneProgressValue

type WorkDoneProgressValue struct {
	Kind string `json:"kind"`
}

type WorkspaceClientCapabilities

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

type WorkspaceFolder

type WorkspaceFolder struct {
	URI  string `json:"uri"`
	Name string `json:"name"`
}

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	Query string `json:"query"`
}

Jump to

Keyboard shortcuts

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