lsp

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunServer

func RunServer(ctx context.Context, stdout *os.File) error

Types

type Configuration added in v0.1.7

type Configuration struct {
	Diag   DiagConfiguration `json:"diag"`
	JPaths []string          `json:"jpaths"`
	Fmt    FmtConfiguration  `json:"fmt"`
}

func (*Configuration) FormatterOptions added in v0.1.7

func (c *Configuration) FormatterOptions() formatter.Options

type DiagConfiguration added in v0.2.6

type DiagConfiguration struct {
	Linter   bool `json:"linter"`
	Evaluate bool `json:"evaluate"`
}

type ErrDiscard

type ErrDiscard struct{}

func (ErrDiscard) Format

func (e ErrDiscard) Format(err error) string

func (ErrDiscard) SetColorFormatter

func (e ErrDiscard) SetColorFormatter(color jsonnet.ColorFormatter)

func (ErrDiscard) SetMaxStackTraceSize

func (e ErrDiscard) SetMaxStackTraceSize(size int)

type EvaluateParams added in v0.1.7

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

type EvaluateResult added in v0.1.7

type EvaluateResult struct {
	Output string `json:"output"`
}

type FallbackServer

type FallbackServer struct{}

func (FallbackServer) CodeAction

func (f FallbackServer) CodeAction(_ context.Context,
	_ *protocol.CodeActionParams) (result []protocol.CodeAction, err error)

func (FallbackServer) CodeLens

func (f FallbackServer) CodeLens(_ context.Context,
	_ *protocol.CodeLensParams) (result []protocol.CodeLens, err error)

func (FallbackServer) CodeLensRefresh

func (f FallbackServer) CodeLensRefresh(_ context.Context) (err error)

func (FallbackServer) CodeLensResolve

func (f FallbackServer) CodeLensResolve(_ context.Context,
	_ *protocol.CodeLens) (result *protocol.CodeLens, err error)

func (FallbackServer) ColorPresentation

func (FallbackServer) Completion

func (FallbackServer) CompletionResolve

func (f FallbackServer) CompletionResolve(_ context.Context,
	_ *protocol.CompletionItem) (result *protocol.CompletionItem, err error)

func (FallbackServer) Declaration

func (f FallbackServer) Declaration(_ context.Context,
	_ *protocol.DeclarationParams) (result []protocol.Location, err error)

func (FallbackServer) Definition

func (f FallbackServer) Definition(_ context.Context,
	_ *protocol.DefinitionParams) (result []protocol.Location, err error)

func (FallbackServer) DidChange

func (FallbackServer) DidChangeConfiguration

func (f FallbackServer) DidChangeConfiguration(_ context.Context,
	_ *protocol.DidChangeConfigurationParams) (err error)

func (FallbackServer) DidChangeWatchedFiles

func (f FallbackServer) DidChangeWatchedFiles(_ context.Context,
	_ *protocol.DidChangeWatchedFilesParams) (err error)

func (FallbackServer) DidChangeWorkspaceFolders

func (f FallbackServer) DidChangeWorkspaceFolders(_ context.Context,
	_ *protocol.DidChangeWorkspaceFoldersParams) (err error)

func (FallbackServer) DidClose

func (FallbackServer) DidCreateFiles

func (f FallbackServer) DidCreateFiles(_ context.Context, _ *protocol.CreateFilesParams) (err error)

func (FallbackServer) DidDeleteFiles

func (f FallbackServer) DidDeleteFiles(_ context.Context, _ *protocol.DeleteFilesParams) (err error)

func (FallbackServer) DidOpen

func (FallbackServer) DidRenameFiles

func (f FallbackServer) DidRenameFiles(_ context.Context, _ *protocol.RenameFilesParams) (err error)

func (FallbackServer) DidSave

func (FallbackServer) DocumentColor

func (FallbackServer) DocumentHighlight

func (f FallbackServer) DocumentLink(_ context.Context,
	_ *protocol.DocumentLinkParams) (result []protocol.DocumentLink, err error)

func (FallbackServer) DocumentLinkResolve

func (f FallbackServer) DocumentLinkResolve(_ context.Context,
	_ *protocol.DocumentLink) (result *protocol.DocumentLink, err error)

func (FallbackServer) DocumentSymbol

func (f FallbackServer) DocumentSymbol(_ context.Context,
	_ *protocol.DocumentSymbolParams) (result []interface{}, err error)

func (FallbackServer) ExecuteCommand

func (f FallbackServer) ExecuteCommand(_ context.Context,
	_ *protocol.ExecuteCommandParams) (result interface{}, err error)

func (FallbackServer) Exit

func (f FallbackServer) Exit(_ context.Context) (err error)

func (FallbackServer) FoldingRanges

func (f FallbackServer) FoldingRanges(_ context.Context,
	_ *protocol.FoldingRangeParams) (result []protocol.FoldingRange, err error)

func (FallbackServer) Formatting

func (FallbackServer) Hover

func (f FallbackServer) Hover(_ context.Context,
	_ *protocol.HoverParams) (result *protocol.Hover, err error)

func (FallbackServer) Implementation

func (f FallbackServer) Implementation(_ context.Context,
	_ *protocol.ImplementationParams) (result []protocol.Location, err error)

func (FallbackServer) Initialize

func (FallbackServer) Initialized

func (f FallbackServer) Initialized(_ context.Context, _ *protocol.InitializedParams) (err error)

func (FallbackServer) LinkedEditingRange

func (FallbackServer) LogTrace

func (f FallbackServer) LogTrace(_ context.Context, _ *protocol.LogTraceParams) (err error)

func (FallbackServer) Moniker

func (f FallbackServer) Moniker(_ context.Context,
	_ *protocol.MonikerParams) (result []protocol.Moniker, err error)

func (FallbackServer) OnTypeFormatting

func (f FallbackServer) OnTypeFormatting(_ context.Context,
	_ *protocol.DocumentOnTypeFormattingParams) (result []protocol.TextEdit, err error)

func (FallbackServer) PrepareCallHierarchy

func (f FallbackServer) PrepareCallHierarchy(_ context.Context,
	_ *protocol.CallHierarchyPrepareParams) (result []protocol.CallHierarchyItem, err error)

func (FallbackServer) PrepareRename

func (f FallbackServer) PrepareRename(_ context.Context,
	_ *protocol.PrepareRenameParams) (result *protocol.Range, err error)

func (FallbackServer) RangeFormatting

func (FallbackServer) References

func (f FallbackServer) References(_ context.Context,
	_ *protocol.ReferenceParams) (result []protocol.Location, err error)

func (FallbackServer) Rename

func (FallbackServer) Request

func (f FallbackServer) Request(_ context.Context, _ string,
	_ interface{}) (result interface{}, err error)

func (FallbackServer) SemanticTokensFull

func (f FallbackServer) SemanticTokensFull(_ context.Context,
	_ *protocol.SemanticTokensParams) (result *protocol.SemanticTokens, err error)

func (FallbackServer) SemanticTokensFullDelta

func (f FallbackServer) SemanticTokensFullDelta(_ context.Context,
	_ *protocol.SemanticTokensDeltaParams) (result interface{}, err error)

func (FallbackServer) SemanticTokensRange

func (f FallbackServer) SemanticTokensRange(_ context.Context,
	_ *protocol.SemanticTokensRangeParams) (result *protocol.SemanticTokens, err error)

func (FallbackServer) SemanticTokensRefresh

func (f FallbackServer) SemanticTokensRefresh(_ context.Context) (err error)

func (FallbackServer) SetTrace

func (f FallbackServer) SetTrace(_ context.Context, _ *protocol.SetTraceParams) (err error)

func (FallbackServer) ShowDocument

func (FallbackServer) Shutdown

func (f FallbackServer) Shutdown(_ context.Context) (err error)

func (FallbackServer) SignatureHelp

func (f FallbackServer) SignatureHelp(_ context.Context,
	_ *protocol.SignatureHelpParams) (result *protocol.SignatureHelp, err error)

func (FallbackServer) Symbols

func (FallbackServer) TypeDefinition

func (f FallbackServer) TypeDefinition(_ context.Context,
	_ *protocol.TypeDefinitionParams) (result []protocol.Location, err error)

func (FallbackServer) WillCreateFiles

func (f FallbackServer) WillCreateFiles(_ context.Context,
	_ *protocol.CreateFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillDeleteFiles

func (f FallbackServer) WillDeleteFiles(_ context.Context,
	_ *protocol.DeleteFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillRenameFiles

func (f FallbackServer) WillRenameFiles(_ context.Context,
	_ *protocol.RenameFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillSave

func (FallbackServer) WillSaveWaitUntil

func (f FallbackServer) WillSaveWaitUntil(_ context.Context,
	_ *protocol.WillSaveTextDocumentParams) (result []protocol.TextEdit, err error)

func (FallbackServer) WorkDoneProgressCancel

func (f FallbackServer) WorkDoneProgressCancel(_ context.Context,
	_ *protocol.WorkDoneProgressCancelParams) (err error)

type FmtConfiguration added in v0.2.6

type FmtConfiguration struct {
	Indent           int    `json:"indent"`
	MaxBlankLines    int    `json:"maxBlankLines"`
	StringStyle      string `json:"stringStyle"`
	CommentStyle     string `json:"commentStyle"`
	PrettyFieldNames bool   `json:"prettyFieldNames"`
	PadArrays        bool   `json:"padArrays"`
	PadObjects       bool   `json:"padObjects"`
	SortImports      bool   `json:"sortImports"`
	ImplicitPlus     bool   `json:"implicitPlus"`
}

type OverlayImporter added in v0.1.2

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

func (*OverlayImporter) Import added in v0.1.2

func (imp *OverlayImporter) Import(from, path string) (jsonnet.Contents, string, error)

func (*OverlayImporter) SetJPaths added in v0.2.4

func (imp *OverlayImporter) SetJPaths(jpaths []string)

type ParseResult

type ParseResult struct {
	Root ast.Node
	Err  error
}

func (*ParseResult) StaticErr

func (p *ParseResult) StaticErr() staticError

type Server

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

func (*Server) Completion

func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, 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 added in v0.1.7

func (s *Server) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) (err error)

func (*Server) DidClose

func (s *Server) DidClose(_ context.Context, params *protocol.DidCloseTextDocumentParams) (err 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) (err error)

func (*Server) DocumentSymbol

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

func (*Server) Evaluate added in v0.1.7

func (s *Server) Evaluate(ctx context.Context, params *EvaluateParams) (*EvaluateResult, error)

func (*Server) ExecuteCommand added in v0.1.7

func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (result interface{}, err error)

func (*Server) Exit

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

func (*Server) Formatting

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

func (*Server) Handler

func (s *Server) Handler() jsonrpc2.Handler

func (*Server) Hover

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

func (*Server) Initialize

func (s *Server) Initialize(ctx context.Context, params *protocol.InitializeParams) (result *protocol.InitializeResult, err error)

func (*Server) Initialized

func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) (err error)

func (*Server) NewResolver

func (s *Server) NewResolver(uri uri.URI) *valueResolver

func (*Server) Shutdown

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

func (*Server) SignatureHelp

func (s *Server) SignatureHelp(ctx context.Context, params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)

Jump to

Keyboard shortcuts

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