Add experimental LSP server for bundle files#4714
Draft
shreyas-goenka wants to merge 7 commits intomainfrom
Draft
Add experimental LSP server for bundle files#4714shreyas-goenka wants to merge 7 commits intomainfrom
shreyas-goenka wants to merge 7 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>
3 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 !!! |
- Add interpolation autocomplete with var shorthand, sequence expansion,
and computed keys (bundle.target, workspace.current_user.*, etc.)
- Add diagnostic publishing for unresolvable ${...} references
- Fix race condition: add sync.RWMutex to Server for concurrent access
- Fix buildDisplayPath leading-dot bug for ${var} without trailing dot
- Extract duplicate URL-building into populateResourceURLs helper
- Change handleDefinition return type from any to []LSPLocation
- Remove terraform state support (direct engine only)
- Remove redundant file watcher patterns
Co-authored-by: Isaac
Use jrpc2.Notify() instead of jrpc2.Callback() for LSP notifications like textDocument/publishDiagnostics. Callback sends a request and blocks waiting for a response, but LSP notifications are fire-and-forget. This caused the server to hang after sending the first diagnostics notification. Also run registerFileWatchers in a goroutine since its Callback blocks waiting for the client response. Co-authored-by: Isaac
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
Adds
databricks experimental bundle-lsp, an LSP server for Databricks Asset Bundle YAML files. Designed to stack with the existing Red Hat YAML language server in VS Code.Features
${...}references to definitions, and from resource keys to all interpolation references${...}interpolation paths including sequence indices,varshorthand, and computed keys (bundle.target,workspace.current_user.*,bundle.git.*)${...}referencesTechnical details
jrpc2sync.RWMutexresources.json(no auth required)Notifyfor LSP notifications (non-blocking)Test plan
This pull request was AI-assisted by Isaac.