MCPcopy
hub / github.com/Doorman11991/smallcode / _request

Method _request

src/lsp/client.js:166–179  ·  view source on GitHub ↗
(method, params)

Source from the content-addressed store, hash-verified

164 }
165
166 _request(method, params) {
167 return new Promise((resolve, reject) => {
168 const id = this.requestId++;
169 this.pending.set(id, { resolve, reject });
170 const msg = { jsonrpc: '2.0', id, method, params };
171 this.process.stdin.write(encodeMessage(msg));
172 setTimeout(() => {
173 if (this.pending.has(id)) {
174 this.pending.delete(id);
175 reject(new Error(`LSP timeout: ${method}`));
176 }
177 }, 10000);
178 });
179 }
180
181 _notify(method, params) {
182 if (!this.process) return;

Callers 2

startMethod · 0.95
stopMethod · 0.95

Calls 3

encodeMessageFunction · 0.85
writeMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected