Skip to content

fix(vscode): update language server module extension to .cjs after tsdown migration#2597

Merged
ymc9 merged 1 commit intodevfrom
fix/vscode-language-server-cjs-extension
Apr 21, 2026
Merged

fix(vscode): update language server module extension to .cjs after tsdown migration#2597
ymc9 merged 1 commit intodevfrom
fix/vscode-language-server-cjs-extension

Conversation

@ymc9
Copy link
Copy Markdown
Member

@ymc9 ymc9 commented Apr 21, 2026

Summary

  • Updates the language server module path from language-server.js to language-server.cjs in the VSCode extension
  • The tsdown build (migrated in chore: migrate from tsup to tsdown #2580) outputs CommonJS files with .cjs extension instead of .js, causing the extension to fail loading the language server

Test plan

  • Build the VSCode extension and verify the language server starts correctly
  • Verify ZModel syntax highlighting and language features work in VSCode

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated language server module configuration for VS Code extension to use the latest build artifact format. This ensures the language server loads correctly in both normal and debug modes.

…down migration

The tsdown build outputs CommonJS files with .cjs extension instead of .js,
so the language server module path must be updated accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 21, 2026

Claude finished @ymc9's task —— View job


PR Review Complete ✅

Reviewed this pull request that fixes the VSCode extension language server module path after tsdown migration.

Review Tasks:

  • Analyze the code change in the modified file
  • Review for code quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Review test coverage implications

Review Feedback

Overall Assessment: LGTM - Clean and Necessary Fix

This is a straightforward and necessary fix that addresses a breaking change introduced by the tsdown migration. The change is minimal, targeted, and correctly implemented.

Code Quality & Best Practices

  • ✅ Excellent: The change is surgical and follows the principle of minimal modification
  • ✅ Consistent: Maintains the existing code structure and patterns
  • ✅ Clear: The change is self-documenting - the file extension clearly indicates the module format

Potential Bugs or Issues

  • ✅ No issues found: The change correctly updates the module path from .js to .cjs
  • ✅ Comprehensive: I verified no other references to language-server.js exist in the VSCode package
  • ✅ Alignment: The change aligns perfectly with the tsdown configuration that specifies format: ['cjs'] in tsdown.config.ts:9

Performance Considerations

  • ✅ No impact: This is purely a module path reference change with zero performance implications
  • ✅ Runtime neutral: The underlying language server functionality remains identical

Security Concerns

  • ✅ No security issues: The change doesn't introduce any new attack vectors
  • ✅ Path safety: Using context.asAbsolutePath() with path.join() maintains secure path resolution
  • ✅ No external dependencies: Change is entirely internal to the extension

Test Coverage

  • ⚠️ Manual testing recommended: As noted in the PR description, this requires manual testing:
    • Build the VSCode extension and verify language server starts correctly
    • Verify ZModel syntax highlighting and language features work
  • 💡 Suggestion: Consider adding an integration test that verifies the language server module can be loaded successfully, though this may be challenging in the VSCode extension test environment

Technical Notes

  • The tsdown build configuration correctly outputs CommonJS format (format: ['cjs'])
  • The package.json main entry point also uses .cjs extension ("main": "./dist/extension.cjs")
  • This change maintains consistency across all generated modules in the VSCode extension

Recommendation

Approve and merge after manual testing confirms the language server loads correctly. This fix is essential for the VSCode extension to function after the tsdown migration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b037efb-8ba5-4552-a350-fbb3c2c10302

📥 Commits

Reviewing files that changed from the base of the PR and between 31f4c49 and bf12c59.

📒 Files selected for processing (1)
  • packages/ide/vscode/src/extension/main.ts

📝 Walkthrough

Walkthrough

The language server module entrypoint path in the VS Code extension was updated from dist/language-server.js to dist/language-server.cjs in both the run.module and debug.module configuration fields, affecting which built artifact is loaded during normal and debug execution modes.

Changes

Cohort / File(s) Summary
Language Server Module Entrypoint
packages/ide/vscode/src/extension/main.ts
Updated language server module path from .js to .cjs format in ServerOptions for both run and debug modes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A path once .js now morphs to .cjs so clean,
The language server hops to modules yet unseen,
From CommonJS bundles, clarity blooms bright,
Debug and run both dance in module light! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and accurately summarizes the main change: updating the language server module extension from .js to .cjs following a tsdown migration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/vscode-language-server-cjs-extension

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.

@ymc9 ymc9 merged commit 8e28c69 into dev Apr 21, 2026
8 checks passed
@ymc9 ymc9 deleted the fix/vscode-language-server-cjs-extension branch April 21, 2026 01:54
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