@treedy/lsp-mcp 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +44 -2
- package/dist/index.js.map +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19835,6 +19835,9 @@ class StdioServerTransport {
|
|
|
19835
19835
|
}
|
|
19836
19836
|
}
|
|
19837
19837
|
|
|
19838
|
+
// src/index.ts
|
|
19839
|
+
import { createRequire as createRequire2 } from "module";
|
|
19840
|
+
|
|
19838
19841
|
// src/config.ts
|
|
19839
19842
|
function loadConfig() {
|
|
19840
19843
|
const pythonEnabled = getEnvBool("LSP_MCP_PYTHON_ENABLED", true);
|
|
@@ -21419,11 +21422,13 @@ Or use file extension auto-detection by providing a file path.
|
|
|
21419
21422
|
}
|
|
21420
21423
|
|
|
21421
21424
|
// src/index.ts
|
|
21425
|
+
var require2 = createRequire2(import.meta.url);
|
|
21426
|
+
var packageJson = require2("../package.json");
|
|
21422
21427
|
var config2 = loadConfig();
|
|
21423
21428
|
var backendManager = new BackendManager(config2);
|
|
21424
21429
|
var server = new McpServer({
|
|
21425
21430
|
name: "lsp-mcp",
|
|
21426
|
-
version:
|
|
21431
|
+
version: packageJson.version
|
|
21427
21432
|
});
|
|
21428
21433
|
registerPrompts(server);
|
|
21429
21434
|
server.registerTool("status", { description: "Get status of all LSP backends and server configuration" }, async () => status(backendManager, config2));
|
|
@@ -21563,6 +21568,43 @@ if (config2.typescript.enabled) {
|
|
|
21563
21568
|
file: exports_external.string().describe("A TypeScript/JavaScript file to check project status for")
|
|
21564
21569
|
}
|
|
21565
21570
|
}, async (args) => backendManager.callTool("typescript", "status", args));
|
|
21571
|
+
server.registerTool("typescript/move", {
|
|
21572
|
+
description: "Move a function, class, or variable to a new file",
|
|
21573
|
+
inputSchema: {
|
|
21574
|
+
file: exports_external.string().describe("Absolute path to the file"),
|
|
21575
|
+
line: exports_external.number().int().positive().describe("Line number (1-based)"),
|
|
21576
|
+
column: exports_external.number().int().positive().describe("Column number (1-based)"),
|
|
21577
|
+
destination: exports_external.string().optional().describe("Destination file path (optional)"),
|
|
21578
|
+
preview: exports_external.boolean().default(false).describe("If true, only show what would change")
|
|
21579
|
+
}
|
|
21580
|
+
}, async (args) => backendManager.callTool("typescript", "move", args));
|
|
21581
|
+
server.registerTool("typescript/function_signature", {
|
|
21582
|
+
description: "Get the current signature of a function at a specific position",
|
|
21583
|
+
inputSchema: {
|
|
21584
|
+
file: exports_external.string().describe("Absolute path to the file"),
|
|
21585
|
+
line: exports_external.number().int().positive().describe("Line number (1-based)"),
|
|
21586
|
+
column: exports_external.number().int().positive().describe("Column number (1-based)")
|
|
21587
|
+
}
|
|
21588
|
+
}, async (args) => backendManager.callTool("typescript", "function_signature", args));
|
|
21589
|
+
server.registerTool("typescript/available_refactors", {
|
|
21590
|
+
description: "Get available refactoring actions at a specific position",
|
|
21591
|
+
inputSchema: {
|
|
21592
|
+
file: exports_external.string().describe("Absolute path to the file"),
|
|
21593
|
+
line: exports_external.number().int().positive().describe("Line number (1-based)"),
|
|
21594
|
+
column: exports_external.number().int().positive().describe("Column number (1-based)")
|
|
21595
|
+
}
|
|
21596
|
+
}, async (args) => backendManager.callTool("typescript", "available_refactors", args));
|
|
21597
|
+
server.registerTool("typescript/apply_refactor", {
|
|
21598
|
+
description: "Apply a specific refactoring action at a position",
|
|
21599
|
+
inputSchema: {
|
|
21600
|
+
file: exports_external.string().describe("Absolute path to the file"),
|
|
21601
|
+
line: exports_external.number().int().positive().describe("Line number (1-based)"),
|
|
21602
|
+
column: exports_external.number().int().positive().describe("Column number (1-based)"),
|
|
21603
|
+
refactorName: exports_external.string().describe("Name of the refactoring"),
|
|
21604
|
+
actionName: exports_external.string().describe("Name of the action"),
|
|
21605
|
+
preview: exports_external.boolean().default(false).describe("If true, only show what would change")
|
|
21606
|
+
}
|
|
21607
|
+
}, async (args) => backendManager.callTool("typescript", "apply_refactor", args));
|
|
21566
21608
|
}
|
|
21567
21609
|
async function gracefulShutdown(signal) {
|
|
21568
21610
|
console.error(`
|
|
@@ -21597,4 +21639,4 @@ main().catch((error2) => {
|
|
|
21597
21639
|
process.exit(1);
|
|
21598
21640
|
});
|
|
21599
21641
|
|
|
21600
|
-
//# debugId=
|
|
21642
|
+
//# debugId=42A9C81F8A74BE4464756E2164756E21
|