Merge branch 'main' into tyriar/274723_platform_terminal__api

This commit is contained in:
Daniel Imms
2025-11-10 06:57:41 -08:00
committed by GitHub
140 changed files with 787 additions and 429 deletions

View File

@@ -4,8 +4,10 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import * as fs from 'fs';
import { join } from 'path';
import 'mocha';
import { ChatContext, ChatRequest, ChatRequestTurn, ChatRequestTurn2, ChatResult, Disposable, Event, EventEmitter, chat, commands, lm } from 'vscode';
import { ChatContext, ChatRequest, ChatRequestTurn, ChatRequestTurn2, ChatResult, Disposable, env, Event, EventEmitter, chat, commands, lm, UIKind } from 'vscode';
import { DeferredPromise, asPromise, assertNoRpc, closeAllEditors, delay, disposeAll } from '../utils';
suite('chat', () => {
@@ -214,4 +216,28 @@ suite('chat', () => {
// Title provider was not called again
assert.strictEqual(calls, 1);
});
test('can access node-pty module', async function () {
// Required for copilot cli in chat extension.
if (env.uiKind === UIKind.Web) {
this.skip();
}
const nodePtyModules = [
join(env.appRoot, 'node_modules.asar', 'node-pty'),
join(env.appRoot, 'node_modules', 'node-pty')
];
for (const modulePath of nodePtyModules) {
// try to stat and require module
try {
await fs.promises.stat(modulePath);
const nodePty = require(modulePath);
assert.ok(nodePty, `Successfully required node-pty from ${modulePath}`);
return;
} catch (err) {
// failed to require, try next
}
}
assert.fail('Failed to find and require node-pty module');
});
});