lspservice

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInStrings

func FindInStrings(a []string, x string) int

func IsBuiltInType

func IsBuiltInType(typeToCheckUnaliased dtype.Type) bool

Types

type Compiler

type Compiler interface {
	Compile(filename string) (*decorated.Module, error)
}

type DecoratedTokenScanner

type DecoratedTokenScanner interface {
	FindToken(documentURI token.DocumentURI, position token.Position) decorated.TypeOrToken
	RootTokens(documentURI token.DocumentURI) []decorated.TypeOrToken
}

type DiagnosticsForDocument

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

func (*DiagnosticsForDocument) Add

func (d *DiagnosticsForDocument) Add(lspDiagnostic lsp.Diagnostic)

func (*DiagnosticsForDocument) All

func (d *DiagnosticsForDocument) All() []lsp.Diagnostic

func (*DiagnosticsForDocument) Clear

func (d *DiagnosticsForDocument) Clear()

func (*DiagnosticsForDocument) IsEmpty

func (d *DiagnosticsForDocument) IsEmpty() bool

type DiagnosticsForDocuments

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

func NewDiagnosticsForDocuments

func NewDiagnosticsForDocuments() *DiagnosticsForDocuments

func (*DiagnosticsForDocuments) Add

func (d *DiagnosticsForDocuments) Add(localPath LocalFileSystemPath, lspDiagnostic lsp.Diagnostic)

func (*DiagnosticsForDocuments) All

func (*DiagnosticsForDocuments) Clear

func (d *DiagnosticsForDocuments) Clear()

func (*DiagnosticsForDocuments) Tidy

func (d *DiagnosticsForDocuments) Tidy()

type DocumentCache

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

func NewDocumentCache

func NewDocumentCache(fallbackProvider loader.DocumentProvider) *DocumentCache

func (*DocumentCache) Close

func (d *DocumentCache) Close(path LocalFileSystemPath) error

func (*DocumentCache) Get

func (*DocumentCache) GetDocumentByVersion

func (d *DocumentCache) GetDocumentByVersion(path LocalFileSystemPath, version DocumentVersion) (*InMemoryDocument, error)

func (*DocumentCache) Open

func (d *DocumentCache) Open(path LocalFileSystemPath, payload string) error

func (*DocumentCache) ReadDocument

func (d *DocumentCache) ReadDocument(path loader.LocalFileSystemPath) (string, error)

func (*DocumentCache) TrackDocument

func (d *DocumentCache) TrackDocument(path LocalFileSystemPath, payload string) error

type DocumentCacher

type DocumentCacher interface {
	GetDocument(filename LocalFileSystemPath, version DocumentVersion) (*InMemoryDocument, error)
}

type DocumentVersion

type DocumentVersion uint

type InMemoryDocument

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

func NewInMemoryDocument

func NewInMemoryDocument(payload string) *InMemoryDocument

func (*InMemoryDocument) DebugLines

func (c *InMemoryDocument) DebugLines()

func (*InMemoryDocument) MakeChange

func (c *InMemoryDocument) MakeChange(editRange token.Range, text string) error

func (*InMemoryDocument) Overwrite

func (c *InMemoryDocument) Overwrite(payload string)

func (*InMemoryDocument) UpdateVersion

func (c *InMemoryDocument) UpdateVersion(newVersion DocumentVersion) error

type LineInfo

type LineInfo struct {
	OffsetInPayload uint
	LineLength      uint
}

func (LineInfo) OffsetFromColumn

func (l LineInfo) OffsetFromColumn(column uint) (uint, error)

type LocalFileSystemPath

type LocalFileSystemPath string

type LspImpl

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

func NewLspImpl

func NewLspImpl(fallbackProvider loader.DocumentProvider, configuration environment.Environment) *LspImpl

func (*LspImpl) AllModules

func (l *LspImpl) AllModules() []*decorated.Module

func (*LspImpl) Compile

func (l *LspImpl) Compile(filename string) (*decorated.Module, error)

func (*LspImpl) FindModuleHelper

func (l *LspImpl) FindModuleHelper(sourceFile token.DocumentURI) *decorated.Module

func (*LspImpl) FindToken

func (l *LspImpl) FindToken(sourceFile token.DocumentURI, position token.Position) decorated.TypeOrToken

func (*LspImpl) GetDocument

func (l *LspImpl) GetDocument(localFilePath LocalFileSystemPath, newVersion DocumentVersion) (*InMemoryDocument, error)

func (*LspImpl) RootTokens

func (l *LspImpl) RootTokens(sourceFile token.DocumentURI) []decorated.TypeOrToken

type SemanticBuilder

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

"tokenTypes": [

"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator"

], "tokenModifiers": [

func NewSemanticBuilder

func NewSemanticBuilder() *SemanticBuilder

func (*SemanticBuilder) EncodeSymbol

func (s *SemanticBuilder) EncodeSymbol(tokenRange token.Range, tokenType string, modifiers []string) error

func (*SemanticBuilder) EncodedValues

func (s *SemanticBuilder) EncodedValues() []uint

type Service

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

func NewService

func NewService(compiler Compiler, scanner DecoratedTokenScanner, documents DocumentCacher, workspacer Workspacer) *Service

func (*Service) CompileAndReportErrors

func (s *Service) CompileAndReportErrors(uri lsp.DocumentURI, version uint, conn lspserv.Connection) error

func (*Service) HandleCodeAction

func (s *Service) HandleCodeAction(params lsp.CodeActionParams, conn lspserv.Connection) (*lsp.CodeAction, error)

func (*Service) HandleCodeActionResolve

func (s *Service) HandleCodeActionResolve(params lsp.CodeAction, conn lspserv.Connection) (*lsp.CodeAction, error)

func (*Service) HandleCodeLens

func (s *Service) HandleCodeLens(params lsp.CodeLensParams, conn lspserv.Connection) ([]*lsp.CodeLens, error)

func (*Service) HandleCodeLensResolve

func (s *Service) HandleCodeLensResolve(params lsp.CodeLens, conn lspserv.Connection) (*lsp.CodeLens, error)

func (*Service) HandleCompletion

func (s *Service) HandleCompletion(params lsp.CompletionParams, conn lspserv.Connection) (*lsp.CompletionList, error)

func (*Service) HandleCompletionItemResolve

func (s *Service) HandleCompletionItemResolve(params lsp.CompletionItem, conn lspserv.Connection) (*lsp.CompletionItem, error)

func (*Service) HandleDidChange

func (s *Service) HandleDidChange(params lsp.DidChangeTextDocumentParams, conn lspserv.Connection) error

func (*Service) HandleDidChangeWatchedFiles

func (s *Service) HandleDidChangeWatchedFiles(params lsp.DidChangeWatchedFilesParams, conn lspserv.Connection) error

func (*Service) HandleDidClose

func (s *Service) HandleDidClose(params lsp.DidCloseTextDocumentParams, conn lspserv.Connection) error

func (*Service) HandleDidOpen

func (s *Service) HandleDidOpen(params lsp.DidOpenTextDocumentParams, conn lspserv.Connection) error

func (*Service) HandleDidSave

func (s *Service) HandleDidSave(params lsp.DidSaveTextDocumentParams, conn lspserv.Connection) error

func (*Service) HandleFindReferences

func (s *Service) HandleFindReferences(params lsp.ReferenceParams, conn lspserv.Connection) ([]*lsp.Location, error)

func (*Service) HandleFormatting

func (s *Service) HandleFormatting(params lsp.DocumentFormattingParams, conn lspserv.Connection) ([]*lsp.TextEdit, error)

func (*Service) HandleGotoDeclaration

func (s *Service) HandleGotoDeclaration(params lsp.DeclarationOptions, conn lspserv.Connection) (*lsp.Location, error)

func (*Service) HandleGotoDefinition

func (s *Service) HandleGotoDefinition(params lsp.TextDocumentPositionParams, conn lspserv.Connection) (*lsp.Location, error)

func (*Service) HandleGotoImplementation

func (s *Service) HandleGotoImplementation(params lsp.TextDocumentPositionParams, conn lspserv.Connection) (*lsp.Location, error)

func (*Service) HandleGotoTypeDefinition

func (s *Service) HandleGotoTypeDefinition(params lsp.TextDocumentPositionParams, conn lspserv.Connection) (*lsp.Location, error)

func (*Service) HandleHighlights

func (s *Service) HandleHighlights(params lsp.DocumentHighlightParams,
	conn lspserv.Connection) ([]*lsp.DocumentHighlight, error)

HandleHighlights :

func (*Service) HandleHover

func (s *Service) HandleHover(params lsp.TextDocumentPositionParams, conn lspserv.Connection) (*lsp.Hover, error)

func (*Service) HandleLinkedEditingRange

func (s *Service) HandleLinkedEditingRange(params lsp.LinkedEditingRangeParams, conn lspserv.Connection) (*lsp.LinkedEditingRanges, error)

func (*Service) HandleRename

func (s *Service) HandleRename(params lsp.RenameParams) (*lsp.WorkspaceEdit, error)

func (*Service) HandleSemanticTokensFull

func (s *Service) HandleSemanticTokensFull(params lsp.SemanticTokensParams, conn lspserv.Connection) (*lsp.SemanticTokens, error)

func (*Service) HandleSignatureHelp

func (s *Service) HandleSignatureHelp(params lsp.TextDocumentPositionParams, conn lspserv.Connection) (*lsp.SignatureHelp, error)

func (*Service) HandleSymbol

func (s *Service) HandleSymbol(params lsp.DocumentSymbolParams, conn lspserv.Connection) ([]*lsp.DocumentSymbol, error)

func (*Service) HandleWillSave

func (s *Service) HandleWillSave(params lsp.WillSaveTextDocumentParams, conn lspserv.Connection) error

func (*Service) Reset

func (s *Service) Reset() error

func (*Service) ResetCaches

func (s *Service) ResetCaches(lock bool)

func (*Service) ShutDown

func (s *Service) ShutDown()

type Workspacer

type Workspacer interface {
	AllModules() []*decorated.Module
}

Jump to

Keyboard shortcuts

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