feat: extend ALS with symbol navigation, references, rename, and workspace symbols#2647
Draft
arikon wants to merge 17 commits intoansible:mainfrom
Draft
feat: extend ALS with symbol navigation, references, rename, and workspace symbols#2647arikon wants to merge 17 commits intoansible:mainfrom
arikon wants to merge 17 commits intoansible:mainfrom
Conversation
f5df827 to
6af7b6e
Compare
Adds Document Symbol support to the Ansible Language Server, enabling outline view and breadcrumbs in editors. Supports plays, tasks, blocks, roles, and task sections (handlers, pre_tasks, post_tasks). Falls back to flat SymbolInformation when the client lacks hierarchical support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use node: protocol for fs and path imports in cli.ts - Extract collectPlayChildren to reduce cognitive complexity - Add tests for edge cases (nameless play/block, non-sequence YAML) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests for uncovered edge cases in documentSymbolProvider: - Task fallback to "Task" when no name or module is present - Play fallback to "Play" when hosts is absent - Role with "name" key instead of "role" key Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix null type cast in processRootSequence return type - Extract blockSectionKeys constant to eliminate regex duplication - Rename getKeyRange to getSelectionRange for accurate semantics - Add comment explaining single YAML document limitation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace all `{} as any` with typed emptyDocsLibrary mock
- Add null-case tests for non-symbol position and non-existent role
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tests for handler, variable, filePath, and role definitions - Add cross-file role definition tests - Add null-case tests for definition provider - Add dict-format vars completion test for Jinja2 brackets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add unified symbol extraction (ansibleSymbols.ts) supporting handlers, variables, file paths, and roles across playbooks and role directories. Add role resolver (roleResolver.ts) for path resolution, argument_specs parsing, and cross-file symbol search. Extend ansibleConfig with roles_paths support. Include comprehensive test suites and fixtures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire up onReferences, onRenameRequest, onPrepareRename, and onWorkspaceSymbol handlers in the language service. The rename provider handles handler notify/name/listen co-rename matrix. Workspace symbol provider supports fuzzy search with caching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add symbol-based hover and go-to-definition for handlers, variables, file paths, and roles. Extend completion to support dict-format vars and role variables via roleResolver integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove dynamic_inventory.py and new_ansible_config.cfg from completion fixtures — no test references these files directly or indirectly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document implemented and planned LSP features including completions, hover, diagnostics, document symbols, references, rename, and workspace symbols. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1806fd8 to
9683c1a
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…esolver Split ansibleSymbols.ts into focused modules (handlerSymbols, variableSymbols, moduleSymbols, symbolDefinitions). Export shared patterns from ansible.ts, add workspace symbol cache invalidation, fix nested /roles/ path resolution, and add escapeRegex utility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…iders Pass rolesPaths from AnsibleConfig to definition, hover, references, rename, and workspace symbol providers so roles in DEFAULT_ROLES_PATH are resolved correctly. Also fix getRoleContextFromUri to check rolesPaths before /roles/ path fallback, supporting nested vendor roles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Unblock the LSP event loop by replacing heavy synchronous fs operations (readFileSync, readdirSync) with their async equivalents from fs/promises. Light single-syscall ops (existsSync, statSync, lstatSync, mkdirSync) are intentionally kept synchronous. docsParser.ts is excluded (separate task). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Extends the Ansible Language Server with comprehensive LSP navigation features built on a unified symbol infrastructure.
New LSP capabilities
Infrastructure
Cleanup
Wait-On: #2665