Skip to content

Commit

Permalink
fix(yamlls): check if yamlls is enabled for symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
qvalentin committed Jul 28, 2024
1 parent cd29aa2 commit c20d90f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/adapter/yamlls/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions internal/adapter/yamlls/symbol_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c20d90f

Please sign in to comment.