mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-15 12:51:00 +01:00
feat: add mock GitHub authentication provider and update activation events for mock chat provider
This commit is contained in:
@@ -11,6 +11,30 @@ const vscode = require('vscode');
|
||||
* @param {vscode.ExtensionContext} context
|
||||
*/
|
||||
function activate(context) {
|
||||
// Register a fake GitHub auth provider so the sessions welcome overlay
|
||||
// sees a signed-in user and dismisses itself.
|
||||
const fakeSession = {
|
||||
id: 'fake-session-id',
|
||||
accessToken: 'fake-token',
|
||||
account: { id: 'test-user', label: 'Test User' },
|
||||
scopes: ['read:user'],
|
||||
};
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.authentication.registerAuthenticationProvider(
|
||||
'github',
|
||||
'GitHub (Mock)',
|
||||
{
|
||||
onDidChangeSessions: new vscode.EventEmitter().event,
|
||||
getSessions: async () => [fakeSession],
|
||||
createSession: async () => fakeSession,
|
||||
removeSession: async () => { },
|
||||
},
|
||||
{ supportsMultipleAccounts: false }
|
||||
)
|
||||
);
|
||||
|
||||
// Register a mock chat participant so chat input works without a real LLM.
|
||||
const participant = vscode.chat.createChatParticipant(
|
||||
'mock-chat-provider.mock',
|
||||
async (_request, _context, stream, _token) => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Provides a mock chat participant for agent sessions testing",
|
||||
"version": "0.0.1",
|
||||
"engines": { "vscode": "*" },
|
||||
"activationEvents": ["onStartupFinished"],
|
||||
"activationEvents": ["*"],
|
||||
"main": "./extension.js",
|
||||
"contributes": {
|
||||
"chatParticipants": [
|
||||
|
||||
Reference in New Issue
Block a user