Skip to content

Conversation

@jonasstrehle
Copy link
Member

@jonasstrehle jonasstrehle commented Nov 12, 2025

This PR adds LSP support for JS combined with unyt-org/datex-core#505

@jonasstrehle jonasstrehle marked this pull request as ready for review November 16, 2025 16:20
Copilot finished reviewing on behalf of jonasstrehle November 16, 2025 16:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Language Server Protocol (LSP) support to the DATEX JavaScript runtime, enabling IDE features like autocompletion and diagnostics for DATEX scripts. It works in conjunction with the datex-core LSP implementation referenced in PR #505.

Key Changes:

  • Added LSP server infrastructure with bidirectional communication between Rust (WASM) and JavaScript
  • Implemented async I/O adapters (Reader/Writer) for LSP message handling
  • Added initial test coverage for basic LSP initialization
  • Updated dependencies to support LSP functionality

Reviewed Changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/lsp/BasicConnect.test.ts New test validating basic LSP initialization flow with JSON-RPC messages
src/runtime/runtime.ts Added startLSP method to Runtime class for starting LSP server with callback-based communication
src/datex-core/datex_core_js.d.ts Updated TypeScript definitions with start_lsp method and reorganized interface definitions
scripts/build-npm.ts Updated import to use simplified path for @std/fs/walk
rs-lib/src/runtime.rs Added conditional LSP support with feature flag, cleaned up imports, improved crypto API usage
rs-lib/src/lsp/mod.rs New module implementing LSP message routing between JavaScript and Rust using channels
rs-lib/src/lsp/io.rs New async I/O adapters (Reader/Writer) implementing futures traits for LSP communication
rs-lib/src/lib.rs Added conditional LSP module import with feature flag
rs-lib/src/crypto/crypto_js.rs Refactored to remove unnecessary borrows and improve API usage
rs-lib/Cargo.toml Added LSP dependencies and feature flag, updated URL crate version, added lsp_wasm feature
deno.lock Updated lock file with new @std/fs dependency version
deno.json Added @std/fs import mapping
Cargo.lock Added LSP-related dependencies (lsp-types, realhydroper-lsp, tower, tracing, etc.)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@benStre benStre merged commit d822f76 into release/0.0.11 Nov 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants