From 0acfa38df80836f035637e144d4e51cbead1584a Mon Sep 17 00:00:00 2001 From: qvalentin Date: Mon, 22 Jul 2024 11:24:56 +0200 Subject: [PATCH] fix(loadDocs): avoid panic if template dir does not exist fixes https://github.com/mrjosh/helm-ls/issues/95 --- internal/handler/text_document.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/handler/text_document.go b/internal/handler/text_document.go index a2ac6b2a..dbde3de9 100644 --- a/internal/handler/text_document.go +++ b/internal/handler/text_document.go @@ -106,6 +106,9 @@ func (h *langHandler) DidRenameFiles(ctx context.Context, params *lsp.RenameFile func (h *langHandler) LoadDocsOnNewChart(rootURI uri.URI) { _ = filepath.WalkDir(filepath.Join(rootURI.Filename(), "templates"), func(path string, d fs.DirEntry, err error) error { + if err != nil { + return err + } if !d.IsDir() { return h.documents.Store(uri.File(path), h.helmlsConfig) }