pi-shazam 0.1.0
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/core/cache.d.ts +50 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +116 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/encoding.d.ts +25 -0
- package/dist/core/encoding.d.ts.map +1 -0
- package/dist/core/encoding.js +109 -0
- package/dist/core/encoding.js.map +1 -0
- package/dist/core/graph.d.ts +146 -0
- package/dist/core/graph.d.ts.map +1 -0
- package/dist/core/graph.js +224 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/pagerank.d.ts +19 -0
- package/dist/core/pagerank.d.ts.map +1 -0
- package/dist/core/pagerank.js +106 -0
- package/dist/core/pagerank.js.map +1 -0
- package/dist/core/scanner.d.ts +19 -0
- package/dist/core/scanner.d.ts.map +1 -0
- package/dist/core/scanner.js +266 -0
- package/dist/core/scanner.js.map +1 -0
- package/dist/core/treesitter-queries.d.ts +19 -0
- package/dist/core/treesitter-queries.d.ts.map +1 -0
- package/dist/core/treesitter-queries.js +222 -0
- package/dist/core/treesitter-queries.js.map +1 -0
- package/dist/core/treesitter.d.ts +67 -0
- package/dist/core/treesitter.d.ts.map +1 -0
- package/dist/core/treesitter.js +624 -0
- package/dist/core/treesitter.js.map +1 -0
- package/dist/hooks/after-write.d.ts +32 -0
- package/dist/hooks/after-write.d.ts.map +1 -0
- package/dist/hooks/after-write.js +111 -0
- package/dist/hooks/after-write.js.map +1 -0
- package/dist/hooks/before-start.d.ts +23 -0
- package/dist/hooks/before-start.d.ts.map +1 -0
- package/dist/hooks/before-start.js +43 -0
- package/dist/hooks/before-start.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/lsp/client.d.ts +77 -0
- package/dist/lsp/client.d.ts.map +1 -0
- package/dist/lsp/client.js +355 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/manager.d.ts +85 -0
- package/dist/lsp/manager.d.ts.map +1 -0
- package/dist/lsp/manager.js +362 -0
- package/dist/lsp/manager.js.map +1 -0
- package/dist/lsp/servers.d.ts +43 -0
- package/dist/lsp/servers.d.ts.map +1 -0
- package/dist/lsp/servers.js +140 -0
- package/dist/lsp/servers.js.map +1 -0
- package/dist/lsp/setup.d.ts +24 -0
- package/dist/lsp/setup.d.ts.map +1 -0
- package/dist/lsp/setup.js +140 -0
- package/dist/lsp/setup.js.map +1 -0
- package/dist/tools/call_chain.d.ts +9 -0
- package/dist/tools/call_chain.d.ts.map +1 -0
- package/dist/tools/call_chain.js +151 -0
- package/dist/tools/call_chain.js.map +1 -0
- package/dist/tools/check.d.ts +18 -0
- package/dist/tools/check.d.ts.map +1 -0
- package/dist/tools/check.js +141 -0
- package/dist/tools/check.js.map +1 -0
- package/dist/tools/codequery.d.ts +19 -0
- package/dist/tools/codequery.d.ts.map +1 -0
- package/dist/tools/codequery.js +128 -0
- package/dist/tools/codequery.js.map +1 -0
- package/dist/tools/codesearch.d.ts +8 -0
- package/dist/tools/codesearch.d.ts.map +1 -0
- package/dist/tools/codesearch.js +101 -0
- package/dist/tools/codesearch.js.map +1 -0
- package/dist/tools/file_detail.d.ts +9 -0
- package/dist/tools/file_detail.d.ts.map +1 -0
- package/dist/tools/file_detail.js +125 -0
- package/dist/tools/file_detail.js.map +1 -0
- package/dist/tools/fix.d.ts +25 -0
- package/dist/tools/fix.d.ts.map +1 -0
- package/dist/tools/fix.js +257 -0
- package/dist/tools/fix.js.map +1 -0
- package/dist/tools/hotspots.d.ts +9 -0
- package/dist/tools/hotspots.d.ts.map +1 -0
- package/dist/tools/hotspots.js +107 -0
- package/dist/tools/hotspots.js.map +1 -0
- package/dist/tools/impact.d.ts +14 -0
- package/dist/tools/impact.d.ts.map +1 -0
- package/dist/tools/impact.js +160 -0
- package/dist/tools/impact.js.map +1 -0
- package/dist/tools/orphan.d.ts +9 -0
- package/dist/tools/orphan.d.ts.map +1 -0
- package/dist/tools/orphan.js +124 -0
- package/dist/tools/orphan.js.map +1 -0
- package/dist/tools/overview.d.ts +9 -0
- package/dist/tools/overview.d.ts.map +1 -0
- package/dist/tools/overview.js +137 -0
- package/dist/tools/overview.js.map +1 -0
- package/dist/tools/ready.d.ts +18 -0
- package/dist/tools/ready.d.ts.map +1 -0
- package/dist/tools/ready.js +145 -0
- package/dist/tools/ready.js.map +1 -0
- package/dist/tools/refs.d.ts +9 -0
- package/dist/tools/refs.d.ts.map +1 -0
- package/dist/tools/refs.js +129 -0
- package/dist/tools/refs.js.map +1 -0
- package/dist/tools/routes.d.ts +8 -0
- package/dist/tools/routes.d.ts.map +1 -0
- package/dist/tools/routes.js +83 -0
- package/dist/tools/routes.js.map +1 -0
- package/dist/tools/state_map.d.ts +8 -0
- package/dist/tools/state_map.d.ts.map +1 -0
- package/dist/tools/state_map.js +95 -0
- package/dist/tools/state_map.js.map +1 -0
- package/dist/tools/symbol.d.ts +9 -0
- package/dist/tools/symbol.d.ts.map +1 -0
- package/dist/tools/symbol.js +84 -0
- package/dist/tools/symbol.js.map +1 -0
- package/dist/tools/verify.d.ts +24 -0
- package/dist/tools/verify.d.ts.map +1 -0
- package/dist/tools/verify.js +212 -0
- package/dist/tools/verify.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi-shazam lsp/client — LSP protocol communication (JSON-RPC over stdio).
|
|
3
|
+
*
|
|
4
|
+
* Uses vscode-jsonrpc/node for wire protocol handling
|
|
5
|
+
* (StreamMessageReader / StreamMessageWriter + createMessageConnection).
|
|
6
|
+
*
|
|
7
|
+
* Ported from repomap/src/lsp.py (StdioLspClient).
|
|
8
|
+
*/
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
import { createRequire } from "node:module";
|
|
12
|
+
const _require = createRequire(import.meta.url);
|
|
13
|
+
// vscode-jsonrpc/node exports for LSP client over stdio
|
|
14
|
+
const rpc = _require("vscode-jsonrpc/node");
|
|
15
|
+
// ── Constants ────────────────────────────────────────────────────────────────
|
|
16
|
+
const MAX_LSP_FILE_SIZE = 1_048_576; // 1 MiB
|
|
17
|
+
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
18
|
+
function pathToUri(filePath) {
|
|
19
|
+
const resolved = path.resolve(filePath);
|
|
20
|
+
// file:// URI with absolute path
|
|
21
|
+
const normalized = resolved.replace(/\\/g, "/");
|
|
22
|
+
if (normalized[0] !== "/") {
|
|
23
|
+
return `file:///${normalized}`;
|
|
24
|
+
}
|
|
25
|
+
return `file://${normalized}`;
|
|
26
|
+
}
|
|
27
|
+
function uriToPath(uri) {
|
|
28
|
+
if (uri.startsWith("file://")) {
|
|
29
|
+
// Handle file:/// on Unix and file:///C:/ on Windows
|
|
30
|
+
let p = uri.slice("file://".length);
|
|
31
|
+
// On Unix, paths start with /
|
|
32
|
+
if (!p.startsWith("/")) {
|
|
33
|
+
p = "/" + p;
|
|
34
|
+
}
|
|
35
|
+
return decodeURIComponent(p);
|
|
36
|
+
}
|
|
37
|
+
return uri;
|
|
38
|
+
}
|
|
39
|
+
function severityName(value) {
|
|
40
|
+
if (value === 1)
|
|
41
|
+
return "error";
|
|
42
|
+
if (value === 2)
|
|
43
|
+
return "warning";
|
|
44
|
+
if (value === 3)
|
|
45
|
+
return "info";
|
|
46
|
+
if (value === 4)
|
|
47
|
+
return "hint";
|
|
48
|
+
return "warning";
|
|
49
|
+
}
|
|
50
|
+
function lspLanguageId(language, filePath) {
|
|
51
|
+
const suffix = path.extname(filePath).toLowerCase();
|
|
52
|
+
if (language === "typescript") {
|
|
53
|
+
if (suffix === ".tsx")
|
|
54
|
+
return "typescriptreact";
|
|
55
|
+
if (suffix === ".jsx")
|
|
56
|
+
return "javascriptreact";
|
|
57
|
+
if ([".js", ".mjs", ".cjs"].includes(suffix))
|
|
58
|
+
return "javascript";
|
|
59
|
+
return "typescript";
|
|
60
|
+
}
|
|
61
|
+
return language;
|
|
62
|
+
}
|
|
63
|
+
// ── LspClient ────────────────────────────────────────────────────────────────
|
|
64
|
+
export class LspClient {
|
|
65
|
+
command;
|
|
66
|
+
workspaceRoot;
|
|
67
|
+
timeout;
|
|
68
|
+
process = null;
|
|
69
|
+
connection = null;
|
|
70
|
+
_openedFiles = new Set();
|
|
71
|
+
_serverCapabilities = {};
|
|
72
|
+
_running = false;
|
|
73
|
+
_log;
|
|
74
|
+
// Store notifications (e.g., diagnostics) received outside request-response
|
|
75
|
+
_notifications = [];
|
|
76
|
+
constructor(command, workspaceRoot, timeout = 8000, log) {
|
|
77
|
+
this.command = command;
|
|
78
|
+
this.workspaceRoot = workspaceRoot;
|
|
79
|
+
this.timeout = timeout;
|
|
80
|
+
this._log = log ?? (() => { });
|
|
81
|
+
}
|
|
82
|
+
// ── State ──────────────────────────────────────────────────────────────────
|
|
83
|
+
isRunning() {
|
|
84
|
+
return this._running;
|
|
85
|
+
}
|
|
86
|
+
isFileOpened(filePath) {
|
|
87
|
+
return this._openedFiles.has(path.resolve(filePath));
|
|
88
|
+
}
|
|
89
|
+
get serverCapabilities() {
|
|
90
|
+
return this._serverCapabilities;
|
|
91
|
+
}
|
|
92
|
+
// ── Lifecycle ──────────────────────────────────────────────────────────────
|
|
93
|
+
start() {
|
|
94
|
+
if (this._running)
|
|
95
|
+
return;
|
|
96
|
+
this._log(`Starting LSP: ${this.command[0]} (workspace: ${this.workspaceRoot})`);
|
|
97
|
+
const [cmd, ...args] = this.command;
|
|
98
|
+
this.process = spawn(cmd, args, {
|
|
99
|
+
cwd: this.workspaceRoot,
|
|
100
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
101
|
+
});
|
|
102
|
+
this.process.on("error", (err) => {
|
|
103
|
+
this._log(`LSP process error: ${err.message}`);
|
|
104
|
+
this._running = false;
|
|
105
|
+
});
|
|
106
|
+
this.process.on("exit", (code, signal) => {
|
|
107
|
+
this._log(`LSP process exited: code=${code}, signal=${signal}`);
|
|
108
|
+
this._running = false;
|
|
109
|
+
});
|
|
110
|
+
// Drain stderr to prevent deadlock
|
|
111
|
+
if (this.process.stderr) {
|
|
112
|
+
this.process.stderr.on("data", (chunk) => {
|
|
113
|
+
this._log(`LSP stderr: ${chunk.toString("utf-8", 0, Math.min(chunk.length, 500))}`);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Create JSON-RPC connection over stdio
|
|
117
|
+
const reader = new rpc.StreamMessageReader(this.process.stdout);
|
|
118
|
+
const writer = new rpc.StreamMessageWriter(this.process.stdin);
|
|
119
|
+
this.connection = rpc.createMessageConnection(reader, writer);
|
|
120
|
+
// Listen for notifications (diagnostics etc.)
|
|
121
|
+
this.connection.onNotification("textDocument/publishDiagnostics", (params) => {
|
|
122
|
+
this._notifications.push(params);
|
|
123
|
+
});
|
|
124
|
+
this.connection.listen();
|
|
125
|
+
this._running = true;
|
|
126
|
+
}
|
|
127
|
+
async initialize() {
|
|
128
|
+
if (!this.connection) {
|
|
129
|
+
throw new Error("LSP client not started");
|
|
130
|
+
}
|
|
131
|
+
const initParams = {
|
|
132
|
+
processId: process.pid,
|
|
133
|
+
rootUri: pathToUri(this.workspaceRoot),
|
|
134
|
+
capabilities: {
|
|
135
|
+
textDocument: {
|
|
136
|
+
publishDiagnostics: {},
|
|
137
|
+
synchronization: {},
|
|
138
|
+
definition: {},
|
|
139
|
+
references: {},
|
|
140
|
+
hover: {},
|
|
141
|
+
documentSymbol: {
|
|
142
|
+
hierarchicalDocumentSymbolSupport: true,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
workspaceFolders: null,
|
|
147
|
+
};
|
|
148
|
+
const result = await this.connection.sendRequest("initialize", initParams);
|
|
149
|
+
this._serverCapabilities =
|
|
150
|
+
result.capabilities ??
|
|
151
|
+
{};
|
|
152
|
+
await this.connection.sendNotification("initialized", {});
|
|
153
|
+
this._log(`LSP initialized: ${this.command[0]}`);
|
|
154
|
+
}
|
|
155
|
+
async didOpen(filePath, text) {
|
|
156
|
+
if (!this.connection) {
|
|
157
|
+
throw new Error("LSP client not started");
|
|
158
|
+
}
|
|
159
|
+
// Skip large files
|
|
160
|
+
const byteLength = Buffer.byteLength(text, "utf-8");
|
|
161
|
+
if (byteLength > MAX_LSP_FILE_SIZE) {
|
|
162
|
+
this._log(`Skipping LSP for large file ${filePath} (${byteLength} bytes)`);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const uri = pathToUri(filePath);
|
|
166
|
+
const params = {
|
|
167
|
+
textDocument: {
|
|
168
|
+
uri,
|
|
169
|
+
languageId: lspLanguageId(this._detectLanguage(filePath), filePath),
|
|
170
|
+
version: 1,
|
|
171
|
+
text,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
await this.connection.sendNotification("textDocument/didOpen", params);
|
|
175
|
+
this._openedFiles.add(path.resolve(filePath));
|
|
176
|
+
}
|
|
177
|
+
async request(method, params) {
|
|
178
|
+
if (!this.connection) {
|
|
179
|
+
throw new Error("LSP client not started");
|
|
180
|
+
}
|
|
181
|
+
return this.connection.sendRequest(method, params);
|
|
182
|
+
}
|
|
183
|
+
// ── Protocol methods ───────────────────────────────────────────────────────
|
|
184
|
+
async definition(filePath, line, character) {
|
|
185
|
+
if (!this.isFileOpened(filePath))
|
|
186
|
+
return null;
|
|
187
|
+
const params = {
|
|
188
|
+
textDocument: { uri: pathToUri(filePath) },
|
|
189
|
+
position: { line, character },
|
|
190
|
+
};
|
|
191
|
+
try {
|
|
192
|
+
const result = await this.connection.sendRequest("textDocument/definition", params);
|
|
193
|
+
return result ?? null;
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async references(filePath, line, character) {
|
|
200
|
+
if (!this.isFileOpened(filePath))
|
|
201
|
+
return null;
|
|
202
|
+
const params = {
|
|
203
|
+
textDocument: { uri: pathToUri(filePath) },
|
|
204
|
+
position: { line, character },
|
|
205
|
+
context: { includeDeclaration: true },
|
|
206
|
+
};
|
|
207
|
+
try {
|
|
208
|
+
const result = await this.connection.sendRequest("textDocument/references", params);
|
|
209
|
+
return result ?? null;
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
async hover(filePath, line, character) {
|
|
216
|
+
if (!this.isFileOpened(filePath))
|
|
217
|
+
return null;
|
|
218
|
+
const params = {
|
|
219
|
+
textDocument: { uri: pathToUri(filePath) },
|
|
220
|
+
position: { line, character },
|
|
221
|
+
};
|
|
222
|
+
try {
|
|
223
|
+
const result = await this.connection.sendRequest("textDocument/hover", params);
|
|
224
|
+
return result ?? null;
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
async documentSymbols(filePath) {
|
|
231
|
+
if (!this.isFileOpened(filePath))
|
|
232
|
+
return null;
|
|
233
|
+
const params = {
|
|
234
|
+
textDocument: { uri: pathToUri(filePath) },
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
const result = await this.connection.sendRequest("textDocument/documentSymbol", params);
|
|
238
|
+
return result ?? null;
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// ── Diagnostics ────────────────────────────────────────────────────────────
|
|
245
|
+
/**
|
|
246
|
+
* Collect diagnostics for a set of file paths.
|
|
247
|
+
* Checks accumulated notifications first, then polls briefly for more.
|
|
248
|
+
*/
|
|
249
|
+
collectDiagnostics(filePaths) {
|
|
250
|
+
const expectedUris = new Set(filePaths.filter((f) => this.isFileOpened(f)).map((f) => pathToUri(f)));
|
|
251
|
+
if (expectedUris.size === 0)
|
|
252
|
+
return [];
|
|
253
|
+
const results = [];
|
|
254
|
+
const remaining = [];
|
|
255
|
+
for (const notif of this._notifications) {
|
|
256
|
+
if (expectedUris.has(notif.uri)) {
|
|
257
|
+
results.push(notif);
|
|
258
|
+
expectedUris.delete(notif.uri);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
remaining.push(notif);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this._notifications = remaining;
|
|
265
|
+
return results;
|
|
266
|
+
}
|
|
267
|
+
// ── Close ──────────────────────────────────────────────────────────────────
|
|
268
|
+
close() {
|
|
269
|
+
if (!this.process || !this._running)
|
|
270
|
+
return;
|
|
271
|
+
this._log(`Closing LSP: ${this.command[0]}`);
|
|
272
|
+
try {
|
|
273
|
+
if (this.connection) {
|
|
274
|
+
// Send shutdown request (best-effort)
|
|
275
|
+
this.connection.sendRequest("shutdown").catch(() => { });
|
|
276
|
+
this.connection.sendNotification("exit");
|
|
277
|
+
this.connection.dispose();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
// Best-effort cleanup
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
if (this.process.exitCode === null) {
|
|
285
|
+
setTimeout(() => {
|
|
286
|
+
if (this.process && this.process.exitCode === null) {
|
|
287
|
+
this.process.kill();
|
|
288
|
+
}
|
|
289
|
+
}, 2000);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
// Already dead
|
|
294
|
+
}
|
|
295
|
+
this._running = false;
|
|
296
|
+
this.connection = null;
|
|
297
|
+
this.process = null;
|
|
298
|
+
this._openedFiles.clear();
|
|
299
|
+
this._notifications = [];
|
|
300
|
+
}
|
|
301
|
+
// ── Internal ───────────────────────────────────────────────────────────────
|
|
302
|
+
_detectLanguage(filePath) {
|
|
303
|
+
// Simple extension-based detection for didOpen
|
|
304
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
305
|
+
const map = {
|
|
306
|
+
".py": "python",
|
|
307
|
+
".pyi": "python",
|
|
308
|
+
".pyx": "python",
|
|
309
|
+
".pxd": "python",
|
|
310
|
+
".ts": "typescript",
|
|
311
|
+
".tsx": "typescriptreact",
|
|
312
|
+
".mts": "typescript",
|
|
313
|
+
".cts": "typescript",
|
|
314
|
+
".js": "javascript",
|
|
315
|
+
".jsx": "javascriptreact",
|
|
316
|
+
".mjs": "javascript",
|
|
317
|
+
".cjs": "javascript",
|
|
318
|
+
".go": "go",
|
|
319
|
+
".rs": "rust",
|
|
320
|
+
".json": "json",
|
|
321
|
+
".jsonc": "jsonc",
|
|
322
|
+
".json5": "json5",
|
|
323
|
+
".yaml": "yaml",
|
|
324
|
+
".yml": "yaml",
|
|
325
|
+
};
|
|
326
|
+
return map[ext] ?? "plaintext";
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
export function convertDiagnostics(projectRoot, uri, rawDiagnostics) {
|
|
330
|
+
const filePath = uriToPath(uri);
|
|
331
|
+
const relFile = path.relative(projectRoot, filePath) || filePath;
|
|
332
|
+
return rawDiagnostics.map((d) => ({
|
|
333
|
+
file: relFile,
|
|
334
|
+
line: d.range.start.line + 1, // LSP 0-based → 1-based
|
|
335
|
+
col: d.range.start.character + 1,
|
|
336
|
+
endLine: d.range.end.line + 1,
|
|
337
|
+
endCol: d.range.end.character + 1,
|
|
338
|
+
severity: severityName(d.severity),
|
|
339
|
+
code: String(d.code ?? ""),
|
|
340
|
+
message: d.message,
|
|
341
|
+
source: d.source ?? "lsp",
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
export function convertLocation(projectRoot, loc) {
|
|
345
|
+
const filePath = uriToPath(loc.uri);
|
|
346
|
+
const relFile = path.relative(projectRoot, filePath) || filePath;
|
|
347
|
+
return {
|
|
348
|
+
file: relFile,
|
|
349
|
+
line: loc.range.start.line + 1,
|
|
350
|
+
col: loc.range.start.character + 1,
|
|
351
|
+
endLine: loc.range.end.line + 1,
|
|
352
|
+
endCol: loc.range.end.character + 1,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=client.js.map
|
|
@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AC,CAAC,MAAM,IAAI,KAAK;KACzB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAC9B,WAAmB,EACnB,GAAa;IAEb,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC;IAEjE,OAAO;QACN,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;QAC9B,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC;QAClC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;QAC/B,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC;KACnC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi-shazam lsp/manager — Language server process lifecycle management.
|
|
3
|
+
*
|
|
4
|
+
* Detects project languages, spawns LSP servers on demand,
|
|
5
|
+
* handles health checks, restarts, and graceful shutdown.
|
|
6
|
+
*
|
|
7
|
+
* Ported from repomap/src/lsp.py (detect_project_languages, detect_lsp_server).
|
|
8
|
+
*/
|
|
9
|
+
import { LspClient } from "./client.js";
|
|
10
|
+
import type { LspDiagnostic, LspLocation } from "./client.js";
|
|
11
|
+
export interface LspServerInfo {
|
|
12
|
+
language: string;
|
|
13
|
+
serverName: string;
|
|
14
|
+
client: LspClient;
|
|
15
|
+
command: readonly string[];
|
|
16
|
+
workspaceRoot: string;
|
|
17
|
+
source: "project" | "path" | "user";
|
|
18
|
+
}
|
|
19
|
+
export interface LspServerDetection {
|
|
20
|
+
language: string;
|
|
21
|
+
serverName: string;
|
|
22
|
+
status: "available" | "missing";
|
|
23
|
+
command: string[];
|
|
24
|
+
source: string;
|
|
25
|
+
workspaceRoot: string;
|
|
26
|
+
reason?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LspRunResult {
|
|
29
|
+
server: string;
|
|
30
|
+
language: string;
|
|
31
|
+
status: "ok" | "skipped" | "timeout" | "failed";
|
|
32
|
+
diagnostics: LspDiagnostic[];
|
|
33
|
+
definitions: LspLocation[];
|
|
34
|
+
references: LspLocation[];
|
|
35
|
+
command: string[];
|
|
36
|
+
workspaceRoot: string;
|
|
37
|
+
reason?: string;
|
|
38
|
+
durationMs: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if a path contains any skip directory segment.
|
|
42
|
+
* Used to avoid feeding vendored/generated files to LSP.
|
|
43
|
+
*/
|
|
44
|
+
export declare function shouldSkipPath(filePath: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Walk project root and detect languages from file extensions.
|
|
47
|
+
*/
|
|
48
|
+
export declare function detectProjectLanguages(projectRoot: string, maxFiles?: number): string[];
|
|
49
|
+
export declare function detectLspServer(projectRoot: string, language: string, filePath?: string | null): LspServerDetection;
|
|
50
|
+
export declare class LspManager {
|
|
51
|
+
private projectRoot;
|
|
52
|
+
private servers;
|
|
53
|
+
private log;
|
|
54
|
+
constructor(projectRoot: string, log?: (msg: string) => void);
|
|
55
|
+
/**
|
|
56
|
+
* Auto-detect languages in the project and return what was found.
|
|
57
|
+
*/
|
|
58
|
+
detectLanguages(): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Detect LSP server for a specific language.
|
|
61
|
+
*/
|
|
62
|
+
detectServer(language: string, filePath?: string): LspServerDetection;
|
|
63
|
+
/**
|
|
64
|
+
* Get the LSP client for a given file, creating one if needed.
|
|
65
|
+
* Returns null if no LSP server is available for the file's language.
|
|
66
|
+
*/
|
|
67
|
+
getServerForFile(filePath: string): LspServerInfo | null;
|
|
68
|
+
/**
|
|
69
|
+
* Get or create an LSP client for a language.
|
|
70
|
+
*/
|
|
71
|
+
getServerForLanguage(language: string, filePath?: string): LspServerInfo | null;
|
|
72
|
+
/**
|
|
73
|
+
* Initialize all detected LSP servers.
|
|
74
|
+
*/
|
|
75
|
+
initializeAll(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Get all active LSP servers.
|
|
78
|
+
*/
|
|
79
|
+
getActiveServers(): LspServerInfo[];
|
|
80
|
+
/**
|
|
81
|
+
* Shutdown all LSP servers gracefully.
|
|
82
|
+
*/
|
|
83
|
+
shutdown(): void;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../lsp/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS9D,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,IAAI,GAA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