Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion marimo/_server/lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def get_command(self) -> list[str]:
LOGGER.debug("LSP binary not found at %s", lsp_bin)
return []

copilot_bin = self._lsp_dir() / "copilot" / "language-server.js"
copilot_bin = self._lsp_dir() / "copilot" / "language-server.cjs"
log_file = _loggers.get_log_directory() / "github-copilot-lsp.log"

# Use typed format to avoid quoting issues: copilot:<binary_path>
Expand Down
22 changes: 22 additions & 0 deletions packages/lsp/move.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a benefit of this over cp and mv? If so can we add a comment?


const fs = require("node:fs");
const path = require("node:path");

// Copy node_modules/@github/copilot-language-server/dist/ to dist/
const srcDir = path.join(
__dirname,
"node_modules/@github/copilot-language-server/dist",
);
const destDir = path.join(__dirname, "dist");

// Recursively copy directory
fs.cpSync(srcDir, destDir, { recursive: true, dereference: true });

// Rename language-server.js to language-server.cjs
const oldPath = path.join(destDir, "language-server.js");
const newPath = path.join(destDir, "language-server.cjs");
fs.renameSync(oldPath, newPath);

// biome-ignore lint/suspicious/noConsole: build script
console.log("Successfully copied and renamed language-server files");
2 changes: 1 addition & 1 deletion packages/lsp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"scripts": {
"build:ts": "tsup index.ts --format cjs --minify",
"build:deps": "cp -LR node_modules/@github/copilot-language-server/dist/ dist/",
"build:deps": "node move.js",
"typecheck": "tsgo",
"build": "pnpm run build:ts && pnpm run build:deps",
"test": "vitest"
Expand Down
2 changes: 1 addition & 1 deletion tests/_server/test_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_copilot_server_uses_typed_format(tmp_path: Path) -> None:

copilot_dir = lsp_dir_with_spaces / "copilot"
copilot_dir.mkdir()
copilot_bin = copilot_dir / "language-server.js"
copilot_bin = copilot_dir / "language-server.cjs"
copilot_bin.touch()

# Mock the _lsp_dir method to return our test directory
Expand Down
Loading