vscode-pi-companion 0.2.4 → 0.2.6

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "PI Companion",
4
4
  "description": "Share VS Code context with pi coding agent",
5
5
  "repository": "https://github.com/ravshansbox/vscode-pi-companion",
6
- "version": "0.2.4",
6
+ "version": "0.2.6",
7
7
  "publisher": "ravshansbox",
8
8
  "keywords": [
9
9
  "pi-package"
@@ -21,7 +21,7 @@
21
21
  "watch": "tsc -watch -p ./",
22
22
  "package": "vsce package",
23
23
  "vscode:prepublish": "npm run compile",
24
- "test": "node --import ./test/setup.mjs --test test/*.test.mjs"
24
+ "test": "npm run compile && node --import ./test/setup.mjs --test test/*.test.mjs"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/cors": "^2.8.19",
package/src/ide-server.ts CHANGED
@@ -122,7 +122,7 @@ export class IDEServer {
122
122
  }
123
123
  };
124
124
 
125
- await this.mcpServer!.connect(transport);
125
+ await this.createMcpServer().connect(transport);
126
126
  } else {
127
127
  res.status(400).json({
128
128
  jsonrpc: '2.0',
@@ -359,6 +359,7 @@ export class IDEServer {
359
359
  if (this.httpServer) {
360
360
  await new Promise<void>((resolve) => {
361
361
  this.httpServer!.close(() => resolve());
362
+ this.httpServer!.closeAllConnections();
362
363
  });
363
364
  this.httpServer = undefined;
364
365
  }
@@ -187,10 +187,10 @@ export class OpenFilesManager {
187
187
 
188
188
  // Update selection boundaries
189
189
  if (!editor.selection.isEmpty) {
190
- const startLine = Math.min(editor.selection.anchor.line, editor.selection.active.line) + 1;
191
- const endLine = Math.max(editor.selection.anchor.line, editor.selection.active.line) + 1;
192
- const startChar = Math.min(editor.selection.anchor.character, editor.selection.active.character) + 1;
193
- const endChar = Math.max(editor.selection.anchor.character, editor.selection.active.character) + 1;
190
+ const startLine = editor.selection.start.line + 1;
191
+ const endLine = editor.selection.end.line + 1;
192
+ const startChar = editor.selection.start.character + 1;
193
+ const endChar = editor.selection.end.character + 1;
194
194
 
195
195
  file.selectionStart = { line: startLine, character: startChar };
196
196
  file.selectionEnd = { line: endLine, character: endChar };