Skip to content

feat: implement simple language server#87

Merged
9romise merged 6 commits intomainfrom
server
Mar 23, 2026
Merged

feat: implement simple language server#87
9romise merged 6 commits intomainfrom
server

Conversation

@9romise
Copy link
Member

@9romise 9romise commented Mar 22, 2026

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 22, 2026

📝 Walkthrough

Walkthrough

This PR adds a Volar-based language server and language-service surface: new packages packages/language-server and packages/language-service, plus a CLI wrapper (bin/index.js) and TS configs. The VS Code extension entrypoints (extensions/vscode/package.json) now point to CommonJS builds (./dist/index.cjs) and a new extensions/vscode/src/client.ts exports launch(serverPath: string) to start a Volar LanguageClient. Build configs were updated (tsdown format cjs, added umdToEsm plugin), a plugins/umd-to-esm.ts resolver was added, and the workspace pin catalog for Volar packages was introduced.

Possibly related PRs

  • npmx-dev/vscode-npmx PR 84 — Introduces the Volar language-client, new language-server/service packages, and related build/manifest changes that align with this PR’s integration and packaging.
  • npmx-dev/vscode-npmx PR 82 — Extracts VS Code–independent utilities into npmx-language-core, which this PR consumes when wiring language-server and extension integration.
  • npmx-dev/vscode-npmx PR 81 — Adjusts the extension’s package manifest and build targets in the monorepo migration, touching the same extension manifest and build configuration files modified here.
🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author; however, the changeset clearly implements a language server infrastructure with supporting configuration and build tooling. Add a brief description explaining the purpose of the language server implementation, key components (package.json, server setup, client integration), and any testing performed.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch server

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
Contributor

@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: 3

🧹 Nitpick comments (3)
extensions/vscode/tsdown.config.ts (1)

8-9: Consider adding a brief TODO comment explaining the purpose.

The commented-out copy directives lack context. Adding a short comment explaining these are for future language server bundling would improve maintainability.

   copy: [
     '../../res',
-    // { from: 'node_modules/npmx-language-server/bin/**', to: 'dist/server/bin' },
-    // { from: 'node_modules/npmx-language-server/dist/**', to: 'dist/server/dist' },
+    // TODO: Enable when language server integration is ready
+    // { from: 'node_modules/npmx-language-server/bin/**', to: 'dist/server/bin' },
+    // { from: 'node_modules/npmx-language-server/dist/**', to: 'dist/server/dist' },
   ],
extensions/vscode/src/client.ts (1)

49-51: client.start() returns a Promise that is neither awaited nor returned.

Errors during client startup will be silently swallowed. Consider returning or awaiting the promise so callers can handle failures.

♻️ Option A: Make `launch` async
-export function launch(serverPath: string) {
+export async function launch(serverPath: string) {
   const client = new LanguageClient(
     ...
   )

-  client.start()
+  await client.start()

   return client
 }
♻️ Option B: Return the start promise separately
-  client.start()
-
-  return client
+  return { client, ready: client.start() }
 }
packages/language-server/package.json (1)

34-48: The inlinedDependencies field is non-standard.

This field is not recognised by npm/pnpm and appears to be custom metadata documenting which dependency versions are bundled. This is fine for documentation purposes, but consider whether this information might drift out of sync with actual bundled versions over time.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1983a9f1-40a9-43c5-94f7-44ea4708cc29

📥 Commits

Reviewing files that changed from the base of the PR and between f7a9ffc and 0260c59.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • extensions/vscode/package.json
  • extensions/vscode/src/client.ts
  • extensions/vscode/src/index.ts
  • extensions/vscode/tsdown.config.ts
  • packages/language-core/tsdown.config.ts
  • packages/language-server/bin/index.js
  • packages/language-server/package.json
  • packages/language-server/src/index.ts
  • packages/language-server/src/server.ts
  • packages/language-server/tsconfig.json
  • packages/language-server/tsdown.config.ts
  • packages/language-service/package.json
  • packages/language-service/src/index.ts
  • packages/language-service/tsconfig.json
  • packages/language-service/tsdown.config.ts
  • plugins/umd-to-esm.ts
  • pnpm-workspace.yaml
  • tsconfig.json

Copy link
Contributor

@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

🧹 Nitpick comments (1)
extensions/vscode/tsdown.config.ts (1)

8-10: Please remove commented-out copy directives from config.

Keeping inactive config blocks commented in-place can drift quickly; prefer tracking this in an issue/PR note and keeping tsdown.config.ts executable-only.

As per coding guidelines "Write minimal comments—only when truly necessary, prefix hacks with // HACK:".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d92559d-485b-464d-ae6f-d25e0975ffc2

📥 Commits

Reviewing files that changed from the base of the PR and between 0260c59 and 5caf602.

📒 Files selected for processing (3)
  • extensions/vscode/src/client.ts
  • extensions/vscode/src/index.ts
  • extensions/vscode/tsdown.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • extensions/vscode/src/client.ts

@9romise 9romise added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit 1a6abe8 Mar 23, 2026
19 of 25 checks passed
@9romise 9romise deleted the server branch March 23, 2026 12:25
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