Skip to content

fix: correct astro language server default version to 2.16.2#5

Merged
dansasser merged 3 commits intomainfrom
fix/astro-version
Jan 1, 2026
Merged

fix: correct astro language server default version to 2.16.2#5
dansasser merged 3 commits intomainfrom
fix/astro-version

Conversation

@dansasser
Copy link
Owner

@dansasser dansasser commented Jan 1, 2026

Summary

Fixes Astro Language Server initialization failure caused by referencing a non-existent npm package version.

Problem

The Astro Language Server was failing to initialize with the error:

npm error notarget No matching version found for @astrojs/language-server@2.16.8
npm error notarget A valid install target

This occurred because:

  1. The code had 2.16.8 hardcoded as the default version
  2. Version 2.16.8 does not exist on npm - the latest available is 2.16.2
  3. When the LSP tried to install, npm failed, causing the entire language server manager to not initialize

Fix

Changed the default astro_language_server_version from "2.16.8" to "2.16.2" in two places:

  • Line 117: docstring documentation
  • Line 233: actual default value in config loading

Testing

After this fix:

  • Astro Language Server initializes successfully
  • get_symbols_overview returns symbols correctly for .astro files
  • No npm installation errors in logs

Notes

The .installed_version file was already tracking 2.16.2_5.9.3_5.1.3, indicating the working version was 2.16.2. The code simply needed to match this reality.

Summary by CodeRabbit

  • Chores

    • Updated the default Astro language server version to 2.16.2.
  • Bug Fixes

    • Improved symbol-tree behavior for single-file inputs by returning a clear file-level symbol wrapper and linking child symbols appropriately.

✏️ Tip: You can customize this high-level summary in your review settings.

dansasser and others added 2 commits December 28, 2025 17:01
…ll_symbol_tree

When querying a single file via request_full_symbol_tree(), the method was
returning the root symbols directly without wrapping them in a File symbol.
This broke find_referencing_symbols() for file-as-module patterns like Astro
components, where the file itself IS the symbol (e.g., Layout.astro = Layout).

The directory query path (lines 1188-1213) correctly creates a File symbol
wrapper with kind=SymbolKind.File, but the single file path did not.

This fix applies the same File symbol wrapper pattern to single file queries:
- Uses _open_file_context to get file data
- Creates UnifiedSymbolInformation with kind=File
- Sets proper range, location, and parent-child relationships

This enables find_referencing_symbols("Layout", "src/layouts/Layout.astro")
to correctly find the Layout symbol in Astro components.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@continue
Copy link

continue bot commented Jan 1, 2026

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts


Unsubscribe from All Green comments

@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

📝 Walkthrough

Walkthrough

Updated Astro language server default version (2.16.8 → 2.16.2) and changed symbol-tree behavior: file inputs now produce a file-level UnifiedSymbolInformation wrapper with children parented to it; AL language server delegates single-file symbol handling to the parent implementation.

Changes

Cohort / File(s) Summary
Astro Language Server Configuration
src/solidlsp/language_servers/astro_language_server.py
Default Astro language-server version changed from 2.16.8 to 2.16.2 in docstring and runtime dependency setup.
Symbol Tree Core
src/solidlsp/ls.py
request_full_symbol_tree now wraps file-level root symbols into a single file UnifiedSymbolInformation, sets each root child's parent to that file symbol, and returns the file symbol instead of returning raw root symbols.
AL Language Server Delegation
src/solidlsp/language_servers/al_language_server.py
For single-file inputs, request_full_symbol_tree now delegates to the parent class implementation rather than manually constructing file-level wrapper symbols.

Sequence Diagram(s)

(no sequence diagrams generated)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Add Astro Language Support #2 — Introduced the Astro language-server implementation and its default/versioning behavior; directly related to the version change in astro_language_server.py.

Poem

🐰 I nibble lines and tidy trees,
I swap a version, snug as leaves,
I wrap the roots in gentle care,
Now every symbol has a chair,
Hop—small changes, bigger ease.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: correct astro language server default version to 2.16.2' directly matches the primary change: updating the Astro language server default version from 2.16.8 to 2.16.2 to resolve npm initialization errors.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cd28e5 and 2263468.

📒 Files selected for processing (1)
  • src/solidlsp/language_servers/al_language_server.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Use uv run poe format command for code formatting with BLACK + RUFF - this is the ONLY allowed formatting command
Use uv run poe type-check command for type checking with mypy - this is the ONLY allowed type checking command
Use uv run poe lint to check code style without fixing
Use strict typing with mypy for type checking
Format code with black + ruff

Files:

  • src/solidlsp/language_servers/al_language_server.py
src/solidlsp/language_servers/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When adding new languages, create language server implementation in src/solidlsp/language_servers/

Files:

  • src/solidlsp/language_servers/al_language_server.py
src/solidlsp/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/solidlsp/**/*.py: Implement caching strategy to reduce language server overhead
Implement automatic language server restart on crashes for error recovery
Use async operation for non-blocking language server interactions

Files:

  • src/solidlsp/language_servers/al_language_server.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Use symbol-based editing with LSP for precise code manipulation
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Applies to src/solidlsp/ls.py : SolidLanguageServer (`src/solidlsp/ls.py`) should provide a unified wrapper around Language Server Protocol (LSP) implementations with language-agnostic interface for symbol operations, caching, error recovery, and multiple language server lifecycle handling
📚 Learning: 2025-12-28T13:07:44.082Z
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Applies to src/solidlsp/ls.py : SolidLanguageServer (`src/solidlsp/ls.py`) should provide a unified wrapper around Language Server Protocol (LSP) implementations with language-agnostic interface for symbol operations, caching, error recovery, and multiple language server lifecycle handling

Applied to files:

  • src/solidlsp/language_servers/al_language_server.py
📚 Learning: 2025-12-28T13:07:44.082Z
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Applies to src/serena/tools/symbol_tools.py : Language-aware symbol finding, navigation, and editing should be implemented in `src/serena/tools/symbol_tools.py`

Applied to files:

  • src/solidlsp/language_servers/al_language_server.py
🧬 Code graph analysis (1)
src/solidlsp/language_servers/al_language_server.py (1)
src/solidlsp/ls.py (1)
  • request_full_symbol_tree (1102-1255)
🔇 Additional comments (1)
src/solidlsp/language_servers/al_language_server.py (1)

703-704: Good refactoring to delegate single-file handling to parent.

This change improves consistency by ensuring single-file queries return the same File-wrapped symbol structure as the parent class. The delegation:

  • Leverages the parent's _open_file_context pattern
  • Gets proper File symbol wrapping with range and location
  • Establishes correct parent relationships
  • Adds ignored path checking from parent implementation

This aligns with the PR objective to support file-as-module patterns where the file itself is a symbol container.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b720452 and 9cd28e5.

📒 Files selected for processing (2)
  • src/solidlsp/language_servers/astro_language_server.py
  • src/solidlsp/ls.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.py: Use uv run poe format command for code formatting with BLACK + RUFF - this is the ONLY allowed formatting command
Use uv run poe type-check command for type checking with mypy - this is the ONLY allowed type checking command
Use uv run poe lint to check code style without fixing
Use strict typing with mypy for type checking
Format code with black + ruff

Files:

  • src/solidlsp/ls.py
  • src/solidlsp/language_servers/astro_language_server.py
src/solidlsp/ls.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/solidlsp/ls.py: SolidLanguageServer (src/solidlsp/ls.py) should provide a unified wrapper around Language Server Protocol (LSP) implementations with language-agnostic interface for symbol operations, caching, error recovery, and multiple language server lifecycle handling
When adding new languages, update factory method in src/solidlsp/ls.py

Files:

  • src/solidlsp/ls.py
src/solidlsp/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

src/solidlsp/**/*.py: Implement caching strategy to reduce language server overhead
Implement automatic language server restart on crashes for error recovery
Use async operation for non-blocking language server interactions

Files:

  • src/solidlsp/ls.py
  • src/solidlsp/language_servers/astro_language_server.py
src/solidlsp/language_servers/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When adding new languages, create language server implementation in src/solidlsp/language_servers/

Files:

  • src/solidlsp/language_servers/astro_language_server.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Use symbol-based editing with LSP for precise code manipulation
📚 Learning: 2025-12-28T13:07:44.082Z
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Applies to src/solidlsp/ls.py : SolidLanguageServer (`src/solidlsp/ls.py`) should provide a unified wrapper around Language Server Protocol (LSP) implementations with language-agnostic interface for symbol operations, caching, error recovery, and multiple language server lifecycle handling

Applied to files:

  • src/solidlsp/ls.py
  • src/solidlsp/language_servers/astro_language_server.py
📚 Learning: 2025-12-28T13:07:44.082Z
Learnt from: CR
Repo: dansasser/serena PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-28T13:07:44.082Z
Learning: Applies to src/solidlsp/**/*.py : Use async operation for non-blocking language server interactions

Applied to files:

  • src/solidlsp/language_servers/astro_language_server.py
🧬 Code graph analysis (1)
src/solidlsp/ls.py (1)
src/solidlsp/ls_types.py (3)
  • UnifiedSymbolInformation (189-256)
  • SymbolKind (146-176)
  • Location (85-93)
🔇 Additional comments (2)
src/solidlsp/language_servers/astro_language_server.py (2)

233-233: LGTM! Default version corrected to fix npm installation failures.

The default value now points to version 2.16.2, which resolves the "No matching version found" error mentioned in the PR objectives.


117-117: LGTM! Docstring updated to reflect the correct npm package version.

The version 2.16.2 has been verified as the latest stable release on npm with no direct security vulnerabilities reported for the @astrojs/language-server package.

@dansasser dansasser merged commit 5abb383 into main Jan 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant