From f47e51bedd06a3df1dd64316bb9388b15221acbd Mon Sep 17 00:00:00 2001 From: qvalentin Date: Wed, 8 May 2024 14:27:24 +0200 Subject: [PATCH] fix: not open files should not be sent to yamlls --- internal/adapter/yamlls/documentSync.go | 3 +++ internal/language_features/template_context.go | 3 --- internal/lsp/document_store.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/adapter/yamlls/documentSync.go b/internal/adapter/yamlls/documentSync.go index 02c9bae7..1d566b58 100644 --- a/internal/adapter/yamlls/documentSync.go +++ b/internal/adapter/yamlls/documentSync.go @@ -14,6 +14,9 @@ func (yamllsConnector Connector) InitiallySyncOpenDocuments(docs []*lsplocal.Doc return } for _, doc := range docs { + if !doc.IsOpen { + continue + } yamllsConnector.DocumentDidOpen(doc.Ast, lsp.DidOpenTextDocumentParams{ TextDocument: lsp.TextDocumentItem{ URI: doc.URI, diff --git a/internal/language_features/template_context.go b/internal/language_features/template_context.go index 600cee25..8dcf15af 100644 --- a/internal/language_features/template_context.go +++ b/internal/language_features/template_context.go @@ -26,9 +26,6 @@ func NewTemplateContextFeature(genericDocumentUseCase *GenericDocumentUseCase) * } func (f *TemplateContextFeature) AppropriateForNode() bool { - nodeContent := f.NodeContent() - println(nodeContent) - if f.NodeType == gotemplate.NodeTypeDot || f.NodeType == gotemplate.NodeTypeDotSymbol { return true } diff --git a/internal/lsp/document_store.go b/internal/lsp/document_store.go index c204881d..d7c8428d 100644 --- a/internal/lsp/document_store.go +++ b/internal/lsp/document_store.go @@ -65,7 +65,7 @@ func (s *DocumentStore) Store(uri uri.URI, helmlsConfig util.HelmlsConfiguration Content: string(content), Ast: ast, DiagnosticsCache: NewDiagnosticsCache(helmlsConfig), - IsOpen: true, + IsOpen: false, SymbolTable: NewSymbolTable(ast, content), }, )