Documentation
¶
Overview ¶
Package lsp is the SIML language server: diagnostics, completion, hover, navigation, rename, outline, folding, semantic tokens, formatting and code actions for every *.siml file, and the requests the rotation panel of the VS Code extension makes (siml/rotation, siml/pathAt, siml/registered, siml/splice, siml/database, siml/patterns, siml/insertPattern, siml/sim). It speaks JSON-RPC over a stream, and reads the name table and the item database from the repository each file sits in.
Index ¶
- func Serve(in io.Reader, out io.Writer, opts Options) (shutdownRequested bool, err error)
- type CodeAction
- type CodeLens
- type Command
- type CompletionItem
- type Diagnostic
- type DocumentLink
- type DocumentSymbol
- type FoldingRange
- type Hover
- type InlayHint
- type Location
- type MarkupContent
- type Options
- type Position
- type Range
- type RelatedInformation
- type ResponseError
- type SemanticTokens
- type TextEdit
- type WorkspaceEdit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeAction ¶
type CodeAction struct {
Title string `json:"title"`
Kind string `json:"kind"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
IsPreferred bool `json:"isPreferred,omitempty"`
Edit *WorkspaceEdit `json:"edit,omitempty"`
Command *Command `json:"command,omitempty"`
}
type CompletionItem ¶
type CompletionItem struct {
Label string `json:"label"`
Kind int `json:"kind,omitempty"`
Detail string `json:"detail,omitempty"`
Documentation *MarkupContent `json:"documentation,omitempty"`
SortText string `json:"sortText,omitempty"`
FilterText string `json:"filterText,omitempty"`
InsertText string `json:"insertText,omitempty"`
InsertTextFormat int `json:"insertTextFormat,omitempty"`
TextEdit *TextEdit `json:"textEdit,omitempty"`
Command *Command `json:"command,omitempty"`
}
type Diagnostic ¶
type DocumentLink ¶
type DocumentSymbol ¶
type FoldingRange ¶
type Hover ¶
type Hover struct {
Contents MarkupContent `json:"contents"`
Range *Range `json:"range,omitempty"`
}
type MarkupContent ¶
type Options ¶
type Options struct {
// Sims a request of `wowsimcli siml sim` in the repository at root and gives its result; it stops when ctx is
// done.
Sim func(ctx context.Context, root string, req json.RawMessage) (json.RawMessage, error)
// The game files' row of a spell, as `go run ./tools/spelldata <id>` prints it, for a hover.
Row func(spellID int32) (string, bool)
}
What the server needs from the program that starts it.
type RelatedInformation ¶
type SemanticTokens ¶
type SemanticTokens struct {
Data []uint32 `json:"data"`
}
type WorkspaceEdit ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package jsonrpc is JSON-RPC 2.0 over a stream, framed as the language server protocol frames it: a Content-Length header, a blank line and the body.
|
Package jsonrpc is JSON-RPC 2.0 over a stream, framed as the language server protocol frames it: a Content-Length header, a blank line and the body. |
|
Starts the SIML language server, `wowsimcli siml lsp`, for an editor, from the repository root, through tools/lsplaunch.
|
Starts the SIML language server, `wowsimcli siml lsp`, for an editor, from the repository root, through tools/lsplaunch. |