diff --git a/internal/adapter/yamlls/symbol.go b/internal/adapter/yamlls/symbol.go index 3a3a0df..30a22d1 100644 --- a/internal/adapter/yamlls/symbol.go +++ b/internal/adapter/yamlls/symbol.go @@ -7,7 +7,7 @@ import ( ) func (yamllsConnector Connector) CallDocumentSymbol(ctx context.Context, params *lsp.DocumentSymbolParams) (result []interface{}, err error) { - if yamllsConnector.server == nil { + if !yamllsConnector.shouldRun(params.TextDocument.URI) { return []interface{}{}, nil } return yamllsConnector.server.DocumentSymbol(ctx, params) diff --git a/internal/adapter/yamlls/symbol_integration_test.go b/internal/adapter/yamlls/symbol_integration_test.go index f5040dc..ded8cd4 100644 --- a/internal/adapter/yamlls/symbol_integration_test.go +++ b/internal/adapter/yamlls/symbol_integration_test.go @@ -28,6 +28,10 @@ func TestYamllsDocumentSymoblIntegration(t *testing.T) { file: "../../../testdata/example/templates/ingress.yaml", expectedLen: 6, }, + { + file: "../../../testdata/example/templates/_helpers.tpl", + expectedLen: 0, + }, } for _, tt1 := range testCases { tt := tt1