server

package
v0.2.32 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// All indices match the legend order in GetSemanticTokensLegend.
	TokenTypeAccount        = 0  // namespace
	TokenTypeCommodity      = 1  // type
	TokenTypePayee          = 2  // function
	TokenTypeDate           = 3  // number
	TokenTypeAmount         = 4  // number
	TokenTypeTag            = 5  // decorator
	TokenTypeDirective      = 6  // keyword (shared with rules keyword)
	TokenTypeCode           = 7  // string (shared with tagValue)
	TokenTypeStatus         = 8  // operator (shared with standard operator)
	TokenTypeComment        = 9  // comment
	TokenTypeString         = 7  // string (same index as code)
	TokenTypeOperator       = 8  // operator (same index as status)
	TokenTypeTagValue       = 7  // string (same index as code)
	TokenTypeAccountVirtual = 0  // namespace (same as account; distinguished by abstract modifier)
	TokenTypeNote           = 9  // comment (same index as comment)
	TokenTypeRulesKeyword   = 6  // keyword (same index as directive)
	TokenTypeRulesRegexp    = 10 // regexp
	TokenTypeRulesParameter = 11 // parameter
)
View Source
const (
	ModifierDeclaration = 0
	ModifierDefinition  = 1
	ModifierAbstract    = 5
)

Variables

This section is empty.

Functions

func GetSemanticTokensLegend

func GetSemanticTokensLegend() protocol.SemanticTokensLegend

Types

type CompletionContextType

type CompletionContextType int
const (
	ContextUnknown CompletionContextType = iota
	ContextAccount
	ContextPayee
	ContextCommodity
	ContextTagName
	ContextTagValue
	ContextDate
	ContextDirective
)

type DateFormat

type DateFormat struct {
	Separator    string
	HasYear      bool
	LeadingZeros bool
}

type DefinitionContext

type DefinitionContext int
const (
	DefContextUnknown DefinitionContext = iota
	DefContextAccount
	DefContextCommodity
	DefContextPayee
)

type HoverContext

type HoverContext int
const (
	HoverUnknown HoverContext = iota
	HoverAccount
	HoverAmount
	HoverPayee
	HoverCommodity
	HoverDate
	HoverTag
	HoverTagValue
)

type InlineCompletionContext added in v0.2.2

type InlineCompletionContext struct {
	TriggerKind InlineCompletionTriggerKind `json:"triggerKind"`
}

type InlineCompletionItem added in v0.2.2

type InlineCompletionItem struct {
	InsertText string          `json:"insertText"`
	FilterText string          `json:"filterText,omitempty"`
	Range      *protocol.Range `json:"range,omitempty"`
}

type InlineCompletionList added in v0.2.2

type InlineCompletionList struct {
	Items []InlineCompletionItem `json:"items"`
}

type InlineCompletionParams added in v0.2.2

type InlineCompletionParams struct {
	TextDocument protocol.TextDocumentIdentifier `json:"textDocument"`
	Position     protocol.Position               `json:"position"`
	Context      InlineCompletionContext         `json:"context"`
}

type InlineCompletionTriggerKind added in v0.2.2

type InlineCompletionTriggerKind int
const (
	InlineCompletionTriggerInvoked   InlineCompletionTriggerKind = 1
	InlineCompletionTriggerAutomatic InlineCompletionTriggerKind = 2
)

type PayeeAccountHistoryParams added in v0.2.5

type PayeeAccountHistoryParams struct {
	TextDocument protocol.TextDocumentIdentifier `json:"textDocument"`
}

type PayeeAccountHistoryResult added in v0.2.5

type PayeeAccountHistoryResult struct {
	PayeeAccounts map[string][]string `json:"payeeAccounts"`
	PairUsage     map[string]int      `json:"pairUsage"`
}

type SemanticTokenEncoder

type SemanticTokenEncoder struct {
	// contains filtered or unexported fields
}

func NewSemanticTokenEncoder

func NewSemanticTokenEncoder() *SemanticTokenEncoder

func (*SemanticTokenEncoder) Encode

func (e *SemanticTokenEncoder) Encode(line, col, length, tokenType, modifiers uint32) []uint32

func (*SemanticTokenEncoder) Reset

func (e *SemanticTokenEncoder) Reset()

type SemanticTokensFullOptions added in v0.2.0

type SemanticTokensFullOptions struct {
	Delta bool `json:"delta,omitempty"`
}

type SemanticTokensServerCapabilities added in v0.2.0

type SemanticTokensServerCapabilities struct {
	Legend protocol.SemanticTokensLegend `json:"legend"`
	Range  bool                          `json:"range,omitempty"`
	Full   *SemanticTokensFullOptions    `json:"full,omitempty"`
}

func GetSemanticTokensCapabilities added in v0.2.0

func GetSemanticTokensCapabilities() *SemanticTokensServerCapabilities

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) CodeAction

func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)

func (*Server) CodeLens added in v0.2.8

func (s *Server) CodeLens(_ context.Context, params *protocol.CodeLensParams) ([]protocol.CodeLens, error)

func (*Server) CodeLensResolve added in v0.2.8

func (s *Server) CodeLensResolve(_ context.Context, params *protocol.CodeLens) (*protocol.CodeLens, error)

func (*Server) Completion

func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, error)

func (*Server) CompletionResolve added in v0.2.8

func (s *Server) CompletionResolve(_ context.Context, item *protocol.CompletionItem) (*protocol.CompletionItem, error)

func (*Server) Definition

func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) ([]protocol.Location, error)

func (*Server) DidChange

func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) error

func (*Server) DidChangeConfiguration

func (s *Server) DidChangeConfiguration(_ context.Context, _ *protocol.DidChangeConfigurationParams) error

func (*Server) DidChangeWatchedFiles added in v0.2.8

func (s *Server) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error

func (*Server) DidClose

func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) error

func (*Server) DidOpen

func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error

func (*Server) DidSave

func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) error

func (*Server) DocumentHighlight added in v0.2.8

func (s *Server) DocumentHighlight(_ context.Context, params *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
func (s *Server) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)

func (*Server) DocumentSymbol

func (s *Server) DocumentSymbol(
	ctx context.Context,
	params *protocol.DocumentSymbolParams,
) ([]any, error)

func (*Server) ExecuteCommand

func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (any, error)

func (*Server) Exit

func (s *Server) Exit(ctx context.Context) error

func (*Server) FoldingRanges added in v0.2.0

func (s *Server) FoldingRanges(ctx context.Context, params *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)

func (*Server) Format

func (*Server) GetDocument

func (s *Server) GetDocument(uri protocol.DocumentURI) (string, bool)

func (*Server) GetResolved

func (s *Server) GetResolved(docURI protocol.DocumentURI) *include.ResolvedJournal

func (*Server) Hover

func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (*protocol.Hover, error)

func (*Server) Initialize

func (*Server) Initialized

func (s *Server) Initialized(_ context.Context, _ *protocol.InitializedParams) error

func (*Server) InlineCompletion added in v0.2.2

func (s *Server) InlineCompletion(_ context.Context, params json.RawMessage) (*InlineCompletionList, error)

func (*Server) OnTypeFormatting added in v0.2.8

func (s *Server) OnTypeFormatting(ctx context.Context, params *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)

func (*Server) PayeeAccountHistory added in v0.2.5

func (s *Server) PayeeAccountHistory(_ context.Context, params json.RawMessage) (*PayeeAccountHistoryResult, error)

func (*Server) PrepareRename added in v0.2.0

func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.Range, error)

func (*Server) RangeFormat added in v0.2.8

func (*Server) References

func (s *Server) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)

func (*Server) Rename added in v0.2.0

func (s *Server) Rename(ctx context.Context, params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)

func (*Server) RootURI

func (s *Server) RootURI() string

func (*Server) SelectionRange added in v0.2.8

func (s *Server) SelectionRange(_ context.Context, params *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)

func (*Server) SemanticTokensFull

func (s *Server) SemanticTokensFull(ctx context.Context, params *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)

func (*Server) SemanticTokensFullDelta added in v0.2.0

func (s *Server) SemanticTokensFullDelta(ctx context.Context, params *protocol.SemanticTokensDeltaParams) (any, error)

func (*Server) SemanticTokensRange added in v0.2.0

func (s *Server) SemanticTokensRange(ctx context.Context, params *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)

func (*Server) SetClient

func (s *Server) SetClient(client protocol.Client)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) StoreDocument

func (s *Server) StoreDocument(uri protocol.DocumentURI, content string)

func (*Server) WillSaveWaitUntil added in v0.2.8

WillSaveWaitUntil is intentionally a no-op: formatting is handled by textDocument/formatting to respect the editor's formatOnSave setting.

func (*Server) Workspace

func (s *Server) Workspace() *workspace.Workspace

func (*Server) WorkspaceSymbol added in v0.2.0

func (s *Server) WorkspaceSymbol(ctx context.Context, params *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)

Jump to

Keyboard shortcuts

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