lsp

package
v0.0.0-...-4a73956 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToDocURI

func ToDocURI(uri string) protocol.DocumentURI

Types

type Document

type Document struct {
	URI        string
	LanguageID protocol.LanguageKind
	Version    int32
	Content    string
	AST        *parser.ParsedTemplateFile
}

Document represents a text document with its metadata

type DocumentManager

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

DocumentManager handles document operations

func NewDocumentManager

func NewDocumentManager() *DocumentManager

func (*DocumentManager) Delete

func (m *DocumentManager) Delete(uri string)

func (*DocumentManager) Get

func (*DocumentManager) GetNoFallback

func (m *DocumentManager) GetNoFallback(uri protocol.DocumentURI) (*Document, bool)

func (*DocumentManager) Store

func (m *DocumentManager) Store(uri protocol.DocumentURI, doc *Document)

type ReadWriteCloser

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

ReadWriteCloser combines an io.ReadCloser and io.WriteCloser into a single io.ReadWriteCloser

func NewReadWriteCloser

func NewReadWriteCloser(r io.ReadCloser, w io.WriteCloser) *ReadWriteCloser

NewReadWriteCloser creates a new ReadWriteCloser from separate read and write closers

func (*ReadWriteCloser) Close

func (rwc *ReadWriteCloser) Close() error

Close closes both the reader and writer

func (*ReadWriteCloser) Read

func (rwc *ReadWriteCloser) Read(p []byte) (int, error)

Read reads data from the underlying reader

func (*ReadWriteCloser) Write

func (rwc *ReadWriteCloser) Write(p []byte) (int, error)

Write writes data to the underlying writer

type Server

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

Server represents an LSP server instance

func NewServer

func NewServer(ctx context.Context) *Server

func (*Server) CodeAction

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

func (*Server) CodeLens

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

func (*Server) ColorPresentation

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

func (*Server) Completion

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

func (*Server) Declaration

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(ctx context.Context, params *protocol.DidChangeConfigurationParams) error

func (*Server) DidChangeNotebookDocument

func (s *Server) DidChangeNotebookDocument(ctx context.Context, params *protocol.DidChangeNotebookDocumentParams) error

func (*Server) DidChangeWatchedFiles

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

func (*Server) DidChangeWorkspaceFolders

func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error

func (*Server) DidClose

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

func (*Server) DidCloseNotebookDocument

func (s *Server) DidCloseNotebookDocument(ctx context.Context, params *protocol.DidCloseNotebookDocumentParams) error

func (*Server) DidCreateFiles

func (s *Server) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) error

func (*Server) DidDeleteFiles

func (s *Server) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) error

func (*Server) DidOpen

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

func (*Server) DidOpenNotebookDocument

func (s *Server) DidOpenNotebookDocument(ctx context.Context, params *protocol.DidOpenNotebookDocumentParams) error

func (*Server) DidRenameFiles

func (s *Server) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) error

func (*Server) DidSave

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

func (*Server) DidSaveNotebookDocument

func (s *Server) DidSaveNotebookDocument(ctx context.Context, params *protocol.DidSaveNotebookDocumentParams) error

func (*Server) DocumentColor

func (s *Server) DocumentColor(ctx context.Context, params *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)

func (*Server) DocumentHighlight

func (s *Server) DocumentHighlight(ctx 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) Documents

func (me *Server) Documents() *DocumentManager

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) FoldingRange

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

func (*Server) Formatting

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

func (*Server) Hover

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

func (*Server) Implementation

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

func (*Server) Initialize

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

func (*Server) Initialized

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

func (*Server) InlayHint

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

func (*Server) InlineValue

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

func (*Server) LinkedEditingRange

func (s *Server) LinkedEditingRange(ctx context.Context, params *protocol.LinkedEditingRangeParams) (*protocol.LinkedEditingRanges, error)

func (*Server) Moniker

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

func (*Server) OnTypeFormatting

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

func (*Server) PrepareCallHierarchy

func (s *Server) PrepareCallHierarchy(ctx context.Context, params *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)

func (*Server) PrepareRename

func (*Server) PrepareTypeHierarchy

func (s *Server) PrepareTypeHierarchy(ctx context.Context, params *protocol.TypeHierarchyPrepareParams) ([]protocol.TypeHierarchyItem, error)

func (*Server) Progress

func (s *Server) Progress(ctx context.Context, params *protocol.ProgressParams) error

Required interface methods

func (*Server) RangeFormatting

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

func (*Server) RangesFormatting

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

func (*Server) References

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

func (*Server) Rename

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

func (*Server) Resolve

func (s *Server) Resolve(ctx context.Context, params *protocol.InlayHint) (*protocol.InlayHint, error)

func (*Server) ResolveCodeAction

func (s *Server) ResolveCodeAction(ctx context.Context, params *protocol.CodeAction) (*protocol.CodeAction, error)

func (*Server) ResolveCodeLens

func (s *Server) ResolveCodeLens(ctx context.Context, params *protocol.CodeLens) (*protocol.CodeLens, error)

func (*Server) ResolveCompletionItem

func (s *Server) ResolveCompletionItem(ctx context.Context, params *protocol.CompletionItem) (*protocol.CompletionItem, error)
func (s *Server) ResolveDocumentLink(ctx context.Context, params *protocol.DocumentLink) (*protocol.DocumentLink, error)

func (*Server) ResolveWorkspaceSymbol

func (s *Server) ResolveWorkspaceSymbol(ctx context.Context, params *protocol.WorkspaceSymbol) (*protocol.WorkspaceSymbol, error)

func (*Server) SelectionRange

func (s *Server) SelectionRange(ctx 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

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

func (*Server) SemanticTokensRange

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

func (*Server) SetCallbackClient

func (me *Server) SetCallbackClient(client protocol.Client)

func (*Server) SetTrace

func (s *Server) SetTrace(ctx context.Context, params *protocol.SetTraceParams) error

func (*Server) Shutdown

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

func (*Server) SignatureHelp

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

func (*Server) Subtypes

func (*Server) Supertypes

func (*Server) Symbol

func (*Server) TextDocumentContent

func (s *Server) TextDocumentContent(ctx context.Context, params *protocol.TextDocumentContentParams) (*string, error)

func (*Server) TypeDefinition

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

func (*Server) WillCreateFiles

func (s *Server) WillCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (*protocol.WorkspaceEdit, error)

func (*Server) WillDeleteFiles

func (s *Server) WillDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (*protocol.WorkspaceEdit, error)

func (*Server) WillRenameFiles

func (s *Server) WillRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (*protocol.WorkspaceEdit, error)

func (*Server) WillSave

func (s *Server) WillSave(ctx context.Context, params *protocol.WillSaveTextDocumentParams) error

func (*Server) WillSaveWaitUntil

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

func (*Server) WorkDoneProgressCancel

func (s *Server) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error

Directories

Path Synopsis
protocol
generator
The generate command generates Go declarations from VSCode's description of the Language Server Protocol.
The generate command generates Go declarations from VSCode's description of the Language Server Protocol.
The semtok package provides an encoder for LSP's semantic tokens.
The semtok package provides an encoder for LSP's semantic tokens.

Jump to

Keyboard shortcuts

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