lsp

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDirectChildNodeByStart added in v0.0.8

func FindDirectChildNodeByStart(currentNode *sitter.Node, pointToLookUp sitter.Point) *sitter.Node

func FindRelevantChildNode added in v0.0.6

func FindRelevantChildNode(currentNode *sitter.Node, pointToLookUp sitter.Point) *sitter.Node

func GetDiagnosticFromLinterErr

func GetDiagnosticFromLinterErr(supMsg support.Message) (*lsp.Diagnostic, string, error)

func GetDiagnostics

func GetDiagnostics(uri uri.URI, vals chartutil.Values) []lsp.Diagnostic

GetDiagnostics will run helm linter against the currect document URI using the given values and converts the helm.support.Message to lsp.Diagnostics

func GetDiagnosticsNotification added in v0.0.13

func GetDiagnosticsNotification(chart *charts.Chart, doc *Document) *lsp.PublishDiagnosticsParams

func GetFieldIdentifierPath added in v0.0.4

func GetFieldIdentifierPath(node *sitter.Node, doc *Document) (path string)

func GetLspRangeForNode added in v0.0.4

func GetLspRangeForNode(node *sitter.Node) lsp.Range

func GetSitterPointForLspPos added in v0.0.8

func GetSitterPointForLspPos(pos lsp.Position) sitter.Point

func GetVariableDefinition added in v0.0.6

func GetVariableDefinition(variableName string, node *sitter.Node, template string) *sitter.Node

func GetVariableDefinitionOfNode added in v0.0.6

func GetVariableDefinitionOfNode(node *sitter.Node, template string) *sitter.Node

func IsInElseBranch added in v0.0.8

func IsInElseBranch(node *sitter.Node) bool

func NodeAtPosition added in v0.0.4

func NodeAtPosition(tree *sitter.Tree, position lsp.Position) *sitter.Node

func ParseAst added in v0.0.4

func ParseAst(oldTree *sitter.Tree, content string) *sitter.Tree

func TraverseIdentifierPathUp added in v0.0.4

func TraverseIdentifierPathUp(node *sitter.Node, doc *Document) string

func TrimTemplate added in v0.0.11

func TrimTemplate(gotemplateTree *sitter.Tree, content string) string

TrimTemplate removes all template nodes. This is done by keeping only the text nodes which is easier then removing the template nodes since template nodes could contain other nodes

Types

type DiagnosticsCache added in v0.0.8

type DiagnosticsCache struct {
	YamlDiagnostics []lsp.Diagnostic
	HelmDiagnostics []lsp.Diagnostic
	// contains filtered or unexported fields
}

func NewDiagnosticsCache added in v0.0.8

func NewDiagnosticsCache(helmlsConfig util.HelmlsConfiguration) DiagnosticsCache

func (DiagnosticsCache) GetMergedDiagnostics added in v0.0.8

func (d DiagnosticsCache) GetMergedDiagnostics() (merged []lsp.Diagnostic)

func (*DiagnosticsCache) SetYamlDiagnostics added in v0.0.8

func (d *DiagnosticsCache) SetYamlDiagnostics(diagnostics []lsp.Diagnostic)

func (*DiagnosticsCache) ShouldShowDiagnosticsOnNewYamlDiagnostics added in v0.0.8

func (d *DiagnosticsCache) ShouldShowDiagnosticsOnNewYamlDiagnostics() bool

type Document added in v0.0.5

type Document struct {
	URI                     lsp.DocumentURI
	Path                    string
	NeedsRefreshDiagnostics bool
	Content                 string

	Ast              *sitter.Tree
	DiagnosticsCache DiagnosticsCache
	// contains filtered or unexported fields
}

Document represents an opened file.

func (*Document) ApplyChanges added in v0.0.5

func (d *Document) ApplyChanges(changes []lsp.TextDocumentContentChangeEvent)

ApplyChanges updates the content of the document from LSP textDocument/didChange events.

func (*Document) ApplyChangesToAst added in v0.0.5

func (d *Document) ApplyChangesToAst(newContent string)

func (*Document) GetLine added in v0.0.5

func (d *Document) GetLine(index int) (string, bool)

GetLine returns the line at the given index.

func (*Document) WordAt added in v0.0.5

func (d *Document) WordAt(pos lsp.Position) string

WordAt returns the word found at the given location.

type DocumentStore

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

documentStore holds opened documents.

func NewDocumentStore

func NewDocumentStore() *DocumentStore

func (*DocumentStore) DidOpen

func (s *DocumentStore) DidOpen(params *lsp.DidOpenTextDocumentParams, helmlsConfig util.HelmlsConfiguration) (*Document, error)

func (*DocumentStore) Get

func (s *DocumentStore) Get(docuri uri.URI) (*Document, bool)

func (*DocumentStore) GetAllDocs added in v0.0.8

func (s *DocumentStore) GetAllDocs() []*Document

Jump to

Keyboard shortcuts

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