mirror of https://github.com/microsoft/vscode.git
mcp: open to-trust config in aux window instead of main window (#245173)
* mcp: open to-trust config in aux window instead of main window Fixes #245162 * pr comment
This commit is contained in:
parent
12bf15cc4d
commit
f90087deb4
|
@ -283,7 +283,8 @@ export interface ICustomDialogOptions {
|
|||
export interface ICustomDialogMarkdown {
|
||||
readonly markdown: IMarkdownString;
|
||||
readonly classes?: string[];
|
||||
readonly dismissOnLinkClick?: boolean;
|
||||
/** Custom link handler for markdown content, see {@link IContentActionHandler}. Defaults to {@link openLinkFromMarkdown}. */
|
||||
actionHandler?(link: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -114,12 +114,9 @@ export class BrowserDialogHandler extends AbstractDialogHandler {
|
|||
customOptions.markdownDetails?.forEach(markdownDetail => {
|
||||
const result = this.markdownRenderer.render(markdownDetail.markdown, {
|
||||
actionHandler: {
|
||||
callback: link => {
|
||||
if (markdownDetail.dismissOnLinkClick) {
|
||||
dialog.dispose();
|
||||
}
|
||||
callback: markdownDetail.actionHandler || (link => {
|
||||
return openLinkFromMarkdown(this.openerService, link, markdownDetail.markdown.isTrusted, true /* skip URL validation to prevent another dialog from showing which is unsupported */);
|
||||
},
|
||||
}),
|
||||
disposables: dialogDisposables
|
||||
}
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ import { IStorageService, StorageScope, StorageTarget } from '../../../../platfo
|
|||
import { IWorkspaceFolderData } from '../../../../platform/workspace/common/workspace.js';
|
||||
import { IConfigurationResolverService } from '../../../services/configurationResolver/common/configurationResolver.js';
|
||||
import { ConfigurationResolverExpression, IResolvedValue } from '../../../services/configurationResolver/common/configurationResolverExpression.js';
|
||||
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
||||
import { AUX_WINDOW_GROUP, IEditorService } from '../../../services/editor/common/editorService.js';
|
||||
import { mcpEnabledSection } from './mcpConfiguration.js';
|
||||
import { McpRegistryInputStorage } from './mcpRegistryInputStorage.js';
|
||||
import { IMcpHostDelegate, IMcpRegistry, IMcpResolveConnectionOptions } from './mcpRegistryTypes.js';
|
||||
|
@ -262,7 +262,10 @@ export class McpRegistry extends Disposable implements IMcpRegistry {
|
|||
custom: {
|
||||
markdownDetails: [{
|
||||
markdown: new MarkdownString(localize('mcp.trust.details', '{0} discovered Model Context Protocol servers from {1} (`{2}`). {0} can use their capabilities in Chat.\n\nDo you want to allow running MCP servers from {3}?', this._productService.nameShort, collection.label, collection.serverDefinitions.get().map(s => s.label).join('`, `'), labelWithOrigin)),
|
||||
dismissOnLinkClick: true,
|
||||
actionHandler: () => {
|
||||
const editor = this._editorService.openEditor({ resource: collection.presentation!.origin! }, AUX_WINDOW_GROUP);
|
||||
return editor.then(Boolean);
|
||||
},
|
||||
}]
|
||||
},
|
||||
buttons: [
|
||||
|
|
Loading…
Reference in New Issue