mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-26 03:03:50 +01:00
Merge branch 'main' into merogge/css-rm
This commit is contained in:
+12
-1
@@ -7,6 +7,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const { defineConfig } = require('@vscode/test-cli');
|
||||
const os = require('os');
|
||||
|
||||
/**
|
||||
* A list of extension folders who have opted into tests, or configuration objects.
|
||||
@@ -20,6 +21,16 @@ const extensions = [
|
||||
workspaceFolder: `extensions/markdown-language-features/test-workspace`,
|
||||
mocha: { timeout: 60_000 }
|
||||
},
|
||||
{
|
||||
label: 'ipynb',
|
||||
workspaceFolder: path.join(os.tmpdir(), `ipynb-${Math.floor(Math.random() * 100000)}`),
|
||||
mocha: { timeout: 60_000 }
|
||||
},
|
||||
{
|
||||
label: 'notebook-renderers',
|
||||
workspaceFolder: path.join(os.tmpdir(), `nbout-${Math.floor(Math.random() * 100000)}`),
|
||||
mocha: { timeout: 60_000 }
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -57,7 +68,7 @@ module.exports = defineConfig(extensions.map(extension => {
|
||||
if (!config.platform || config.platform === 'desktop') {
|
||||
config.launchArgs = defaultLaunchArgs;
|
||||
config.useInstallation = {
|
||||
fromPath: process.env.INTEGRATION_TEST_ELECTRON_PATH || `${__dirname}/scripts/code.${process.platform === 'win32' ? 'cmd' : 'sh'}`,
|
||||
fromPath: process.env.INTEGRATION_TEST_ELECTRON_PATH || `${__dirname}/scripts/code.${process.platform === 'win32' ? 'bat' : 'sh'}`,
|
||||
};
|
||||
config.env = {
|
||||
...config.env,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.84.0",
|
||||
"distro": "ca54f82b1adb64bbf5601501cc4edef8043f045c",
|
||||
"distro": "f69d4735763562c6fd1d2a56596fe808865081ed",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
||||
@@ -77,16 +77,12 @@ if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Ipynb tests
|
||||
set IPYNBWORKSPACE=%TEMPDIR%\ipynb-%RANDOM%
|
||||
mkdir %IPYNBWORKSPACE%
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" %IPYNBWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\ipynb --extensionTestsPath=%~dp0\..\extensions\ipynb\out\test %API_TESTS_EXTRA_ARGS%
|
||||
call yarn test-extension -l ipynb
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
echo ### Notebook Output tests
|
||||
set NBOUTWORKSPACE=%TEMPDIR%\nbout-%RANDOM%
|
||||
mkdir %NBOUTWORKSPACE%
|
||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" %NBOUTWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\notebook-renderers --extensionTestsPath=%~dp0\..\extensions\notebook-renderers\out\test %API_TESTS_EXTRA_ARGS%
|
||||
call yarn test-extension -l notebook-renderers
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
||||
echo.
|
||||
|
||||
@@ -97,13 +97,13 @@ kill_app
|
||||
echo
|
||||
echo "### Ipynb tests"
|
||||
echo
|
||||
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/ipynb --extensionTestsPath=$ROOT/extensions/ipynb/out/test $API_TESTS_EXTRA_ARGS
|
||||
yarn test-extension -l ipynb
|
||||
kill_app
|
||||
|
||||
echo
|
||||
echo "### Notebook Output tests"
|
||||
echo
|
||||
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_EXTRA_ARGS $(mktemp -d 2>/dev/null) --extensionDevelopmentPath=$ROOT/extensions/notebook-renderers --extensionTestsPath=$ROOT/extensions/notebook-renderers/out/test $API_TESTS_EXTRA_ARGS
|
||||
yarn test-extension -l notebook-renderers
|
||||
kill_app
|
||||
|
||||
echo
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ChatAgentResultFeedbackKind } from 'vs/workbench/api/common/extHostType
|
||||
import { IChatAgentCommand, IChatAgentRequest, IChatAgentResult } from 'vs/workbench/contrib/chat/common/chatAgents';
|
||||
import { IChatMessage } from 'vs/workbench/contrib/chat/common/chatProvider';
|
||||
import { IChatFollowup, IChatUserActionEvent, InteractiveSessionVoteDirection } from 'vs/workbench/contrib/chat/common/chatService';
|
||||
import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { checkProposedApiEnabled, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import type * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostChatAgents2 implements ExtHostChatAgentsShape2 {
|
||||
@@ -185,6 +185,7 @@ class ExtHostChatAgent {
|
||||
private _description: string | undefined;
|
||||
private _fullName: string | undefined;
|
||||
private _iconPath: URI | undefined;
|
||||
private _isDefault: boolean | undefined;
|
||||
private _onDidReceiveFeedback = new Emitter<vscode.ChatAgentResult2Feedback>();
|
||||
private _onDidPerformAction = new Emitter<vscode.ChatAgentUserActionEvent>();
|
||||
|
||||
@@ -258,6 +259,7 @@ class ExtHostChatAgent {
|
||||
icon: this._iconPath,
|
||||
hasSlashCommands: this._slashCommandProvider !== undefined,
|
||||
hasFollowup: this._followupProvider !== undefined,
|
||||
isDefault: this._isDefault
|
||||
});
|
||||
updateScheduled = false;
|
||||
});
|
||||
@@ -304,6 +306,15 @@ class ExtHostChatAgent {
|
||||
that._followupProvider = v;
|
||||
updateMetadataSoon();
|
||||
},
|
||||
get isDefault() {
|
||||
checkProposedApiEnabled(that.extension, 'defaultChatAgent');
|
||||
return that._isDefault;
|
||||
},
|
||||
set isDefault(v) {
|
||||
checkProposedApiEnabled(that.extension, 'defaultChatAgent');
|
||||
that._isDefault = v;
|
||||
updateMetadataSoon();
|
||||
},
|
||||
get onDidReceiveFeedback() {
|
||||
return that._onDidReceiveFeedback.event;
|
||||
},
|
||||
|
||||
@@ -329,7 +329,8 @@ class AgentCompletions extends Disposable {
|
||||
return null;
|
||||
}
|
||||
|
||||
const agents = this.chatAgentService.getAgents();
|
||||
const agents = this.chatAgentService.getAgents()
|
||||
.filter(a => !a.metadata.isDefault);
|
||||
return <CompletionList>{
|
||||
suggestions: agents.map((c, i) => {
|
||||
const withAt = `@${c.id}`;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Iterable } from 'vs/base/common/iterator';
|
||||
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -36,7 +37,7 @@ export interface IChatAgentMetadata {
|
||||
description?: string;
|
||||
// subCommands: IChatAgentCommand[];
|
||||
requireCommand?: boolean; // Do some agents not have a default action?
|
||||
isImplicit?: boolean; // Only @workspace. slash commands get promoted to the top-level and this agent is invoked when those are used
|
||||
isDefault?: boolean; // The agent invoked when no agent is specified
|
||||
fullName?: string;
|
||||
icon?: URI;
|
||||
}
|
||||
@@ -69,6 +70,7 @@ export interface IChatAgentService {
|
||||
getFollowups(id: string, sessionId: string, token: CancellationToken): Promise<IChatFollowup[]>;
|
||||
getAgents(): Array<IChatAgent>;
|
||||
getAgent(id: string): IChatAgent | undefined;
|
||||
getDefaultAgent(): IChatAgent | undefined;
|
||||
hasAgent(id: string): boolean;
|
||||
updateAgent(id: string, updateMetadata: IChatAgentMetadata): void;
|
||||
}
|
||||
@@ -112,6 +114,10 @@ export class ChatAgentService extends Disposable implements IChatAgentService {
|
||||
this._onDidChangeAgents.fire();
|
||||
}
|
||||
|
||||
getDefaultAgent(): IChatAgent | undefined {
|
||||
return Iterable.find(this._agents.values(), a => !!a.agent.metadata.isDefault)?.agent;
|
||||
}
|
||||
|
||||
getAgents(): Array<IChatAgent> {
|
||||
return Array.from(this._agents.values(), v => v.agent);
|
||||
}
|
||||
|
||||
@@ -507,7 +507,9 @@ export class ChatService extends Disposable implements IChatService {
|
||||
let rawResponse: IChatResponse | null | undefined;
|
||||
let agentOrCommandFollowups: Promise<IChatFollowup[] | undefined> | undefined = undefined;
|
||||
|
||||
if (typeof message === 'string' && agentPart) {
|
||||
const defaultAgent = this.chatAgentService.getDefaultAgent();
|
||||
if (typeof message === 'string' && (agentPart || defaultAgent)) {
|
||||
const agent = (agentPart?.agent ?? defaultAgent)!;
|
||||
const history: IChatMessage[] = [];
|
||||
for (const request of model.getRequests()) {
|
||||
if (!request.response) {
|
||||
@@ -518,11 +520,11 @@ export class ChatService extends Disposable implements IChatService {
|
||||
history.push({ role: ChatMessageRole.Assistant, content: request.response.response.asString() });
|
||||
}
|
||||
|
||||
request = model.addRequest(parsedRequest, agentPart.agent);
|
||||
request = model.addRequest(parsedRequest, agent);
|
||||
const requestProps: IChatAgentRequest = {
|
||||
sessionId,
|
||||
requestId: generateUuid(),
|
||||
message: message,
|
||||
message,
|
||||
variables: {},
|
||||
command: agentSlashCommandPart?.command.name ?? '',
|
||||
};
|
||||
@@ -532,7 +534,7 @@ export class ChatService extends Disposable implements IChatService {
|
||||
requestProps.message = varResult.prompt;
|
||||
}
|
||||
|
||||
const agentResult = await this.chatAgentService.invokeAgent(agentPart.agent.id, requestProps, new Progress<IChatProgress>(p => {
|
||||
const agentResult = await this.chatAgentService.invokeAgent(agent.id, requestProps, new Progress<IChatProgress>(p => {
|
||||
progressCallback(p);
|
||||
}), history, token);
|
||||
rawResponse = {
|
||||
@@ -541,7 +543,7 @@ export class ChatService extends Disposable implements IChatService {
|
||||
timings: agentResult.timings
|
||||
};
|
||||
agentOrCommandFollowups = agentResult?.followUp ? Promise.resolve(agentResult.followUp) :
|
||||
this.chatAgentService.getFollowups(agentPart.agent.id, sessionId, CancellationToken.None);
|
||||
this.chatAgentService.getFollowups(agent.id, sessionId, CancellationToken.None);
|
||||
} else if (commandPart && typeof message === 'string' && this.chatSlashCommandService.hasCommand(commandPart.slashCommand.command)) {
|
||||
request = model.addRequest(parsedRequest);
|
||||
// contributed slash commands
|
||||
|
||||
@@ -38,6 +38,7 @@ export const allApiProposals = Object.freeze({
|
||||
createFileSystemWatcher: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts',
|
||||
customEditorMove: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts',
|
||||
debugFocus: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugFocus.d.ts',
|
||||
defaultChatAgent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatAgent.d.ts',
|
||||
diffCommand: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts',
|
||||
diffContentOptions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts',
|
||||
documentFiltersExclusive: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts',
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
export interface ChatAgent2 {
|
||||
/**
|
||||
* When true, this agent is invoked by default when no other agent is being invoked
|
||||
*/
|
||||
isDefault?: boolean;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user