Add experimental LSP server for bundle files#4714
Draft
shreyas-goenka wants to merge 5 commits intomainfrom
Draft
Add experimental LSP server for bundle files#4714shreyas-goenka wants to merge 5 commits intomainfrom
shreyas-goenka wants to merge 5 commits intomainfrom
Conversation
Two proposals:
1. Replace regex-based ${...} parsing with a proper two-mode character scanner
2. Add "did you mean?" suggestions for invalid variable references
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduces a hidden `databricks bundle lsp` command that starts a Language Server Protocol server for bundle YAML files. The server provides: - Document links: Ctrl+click on resource keys to open them in the Databricks workspace browser - Hover: Shows resource ID, name, and a link to open in Databricks when hovering over resource keys The server reads deployment state from local state files (both direct engine and Terraform) to resolve resource IDs and construct workspace URLs without requiring authentication. Uses github.com/creachadair/jrpc2 for JSON-RPC 2.0 transport (same library used by terraform-ls). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shreyas-goenka
added a commit
to databricks/databricks-vscode
that referenced
this pull request
Mar 12, 2026
Introduces a BundleLSPClient that spawns `databricks bundle lsp` via stdio to provide deployment-aware features for bundle YAML files: - Document links: Ctrl+click on resource keys to open in workspace - Hover: Shows resource ID, name, and workspace link The client connects to the CLI's new hidden LSP server and activates for all bundle YAML files (databricks.yml, databricks.yaml, etc.). Stacks with the existing Red Hat YAML extension. Depends on: databricks/cli#4714 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
Collaborator
|
Commit: a27b67f
11 interesting tests: 9 SKIP, 2 RECOVERED
Top 4 slowest tests (at least 2 minutes):
|
- Ctrl+click on ${...} references navigates to where the path is defined
- Ctrl+click on resource keys shows all interpolation references (peek view)
- Hover on resource keys shows URLs for all targets (up to 10)
- Merged tree loading supports include file resolution
- var.X shorthand resolves to variables.X definitions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use PathToURI() instead of "file://" + path for cross-platform URI construction - Replace platform-specific TestURIToPath with TestURIToPathRoundTrip - Fix gofmt alignment in handler map declarations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The command is now at `databricks experimental bundle-lsp` instead of `databricks bundle lsp`. This better reflects its experimental status. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Commit: a27b67f
16 interesting tests: 7 SKIP, 6 RECOVERED, 3 flaky
Top 20 slowest tests (at least 2 minutes):
|
Contributor
|
this is so cool !!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
databricks bundle lspcommand that starts an LSP server for bundle YAML filesresources.jsonand Terraformterraform.tfstate) to resolve resource IDs without requiring authenticationgithub.com/creachadair/jrpc2for JSON-RPC 2.0 transport (same library used by terraform-ls)New files
bundle/lsp/protocol.go— Minimal LSP type definitionsbundle/lsp/documents.go— Thread-safe document store with YAML parsing vialibs/dynbundle/lsp/resource_index.go— Resource position indexing from parsed YAMLbundle/lsp/state.go— State file reading, URL construction, target/host resolutionbundle/lsp/server.go— jrpc2-based LSP server with all handlersbundle/lsp/server_test.go— 18 unit testsbundle/lsp/server_integration_test.go— 6 integration tests using in-memory jrpc2 channelscmd/bundle/lsp.go— Hidden cobra command with--targetflagTest plan
go test ./bundle/lsp/...)go build ./...)🤖 Generated with Claude Code