Merge branch 'main' into pointer-lock-in-webview

This commit is contained in:
jeffrey
2025-03-17 20:23:31 -07:00
committed by GitHub
486 changed files with 22846 additions and 5241 deletions
+19
View File
@@ -118,6 +118,10 @@ import { IAuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/ele
import { AuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.js';
import { normalizeNFC } from '../../base/common/normalization.js';
import { ICSSDevelopmentService, CSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
import { INativeMcpDiscoveryHelperService, NativeMcpDiscoveryHelperChannelName } from '../../platform/mcp/common/nativeMcpDiscoveryHelper.js';
import { NativeMcpDiscoveryHelperService } from '../../platform/mcp/node/nativeMcpDiscoveryHelperService.js';
import { IWebContentExtractorService } from '../../platform/webContentExtractor/common/webContentExtractor.js';
import { NativeWebContentExtractorService } from '../../platform/webContentExtractor/electron-main/webContentExtractorService.js';
/**
* The main VS Code application. There will only ever be one instance,
@@ -1050,6 +1054,9 @@ export class CodeApplication extends Disposable {
// Native Host
services.set(INativeHostMainService, new SyncDescriptor(NativeHostMainService, undefined, false /* proxied to other processes */));
// Web Contents Extractor
services.set(IWebContentExtractorService, new SyncDescriptor(NativeWebContentExtractorService, undefined, false /* proxied to other processes */));
// Webview Manager
services.set(IWebviewManagerService, new SyncDescriptor(WebviewMainService));
@@ -1123,6 +1130,10 @@ export class CodeApplication extends Disposable {
// Proxy Auth
services.set(IProxyAuthService, new SyncDescriptor(ProxyAuthService));
// MCP
services.set(INativeMcpDiscoveryHelperService, new SyncDescriptor(NativeMcpDiscoveryHelperService));
// Dev Only: CSS service (for ESM)
services.set(ICSSDevelopmentService, new SyncDescriptor(CSSDevelopmentService, undefined, true));
@@ -1193,6 +1204,10 @@ export class CodeApplication extends Disposable {
mainProcessElectronServer.registerChannel('nativeHost', nativeHostChannel);
sharedProcessClient.then(client => client.registerChannel('nativeHost', nativeHostChannel));
// Web Content Extractor
const webContentExtractorChannel = ProxyChannel.fromService(accessor.get(IWebContentExtractorService), disposables);
mainProcessElectronServer.registerChannel('webContentExtractor', webContentExtractorChannel);
// Workspaces
const workspacesChannel = ProxyChannel.fromService(accessor.get(IWorkspacesService), disposables);
mainProcessElectronServer.registerChannel('workspaces', workspacesChannel);
@@ -1226,6 +1241,10 @@ export class CodeApplication extends Disposable {
const externalTerminalChannel = ProxyChannel.fromService(accessor.get(IExternalTerminalMainService), disposables);
mainProcessElectronServer.registerChannel('externalTerminal', externalTerminalChannel);
// MCP
const mcpDiscoveryChannel = ProxyChannel.fromService(accessor.get(INativeMcpDiscoveryHelperService), disposables);
mainProcessElectronServer.registerChannel(NativeMcpDiscoveryHelperChannelName, mcpDiscoveryChannel);
// Logger
const loggerChannel = new LoggerChannel(accessor.get(ILoggerMainService),);
mainProcessElectronServer.registerChannel('logger', loggerChannel);
@@ -120,6 +120,8 @@ import { getCodeDisplayProtocol, getDisplayProtocol } from '../../../base/node/o
import { RequestService } from '../../../platform/request/electron-utility/requestService.js';
import { DefaultExtensionsInitializer } from './contrib/defaultExtensionsInitializer.js';
import { AllowedExtensionsService } from '../../../platform/extensionManagement/common/allowedExtensionsService.js';
import { IExtensionGalleryManifestService } from '../../../platform/extensionManagement/common/extensionGalleryManifest.js';
import { ExtensionGalleryManifestIPCService } from '../../../platform/extensionManagement/common/extensionGalleryManifestServiceIpc.js';
class SharedProcessMain extends Disposable implements IClientConnectionFilter {
@@ -331,6 +333,7 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService, undefined, true));
// Extension Gallery
services.set(IExtensionGalleryManifestService, new ExtensionGalleryManifestIPCService(this.server, productService));
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService, undefined, true));
// Extension Tips
@@ -376,8 +379,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter {
private initChannels(accessor: ServicesAccessor): void {
// const disposables = this._register(new DisposableStore());
// Extensions Management
const channel = new ExtensionManagementChannel(accessor.get(IExtensionManagementService), () => null);
this.server.registerChannel('extensions', channel);
+1
View File
@@ -36,6 +36,7 @@ function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
|| !!argv['uninstall-extension']
|| !!argv['update-extensions']
|| !!argv['locate-extension']
|| !!argv['add-mcp']
|| !!argv['telemetry'];
}
+20 -4
View File
@@ -11,7 +11,7 @@ import { isSigPipeError, onUnexpectedError, setUnexpectedErrorHandler } from '..
import { Disposable } from '../../base/common/lifecycle.js';
import { Schemas } from '../../base/common/network.js';
import { isAbsolute, join } from '../../base/common/path.js';
import { isWindows } from '../../base/common/platform.js';
import { isWindows, isMacintosh } from '../../base/common/platform.js';
import { cwd } from '../../base/common/process.js';
import { URI } from '../../base/common/uri.js';
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
@@ -65,6 +65,9 @@ import { localize } from '../../nls.js';
import { FileUserDataProvider } from '../../platform/userData/common/fileUserDataProvider.js';
import { addUNCHostToAllowlist, getUNCHost } from '../../base/node/unc.js';
import { AllowedExtensionsService } from '../../platform/extensionManagement/common/allowedExtensionsService.js';
import { McpManagementCli } from '../../platform/mcp/common/mcpManagementCli.js';
import { IExtensionGalleryManifestService } from '../../platform/extensionManagement/common/extensionGalleryManifest.js';
import { ExtensionGalleryManifestService } from '../../platform/extensionManagement/common/extensionGalleryManifestService.js';
class CliMain extends Disposable {
@@ -162,9 +165,16 @@ class CliMain extends Disposable {
fileService.registerProvider(Schemas.vscodeUserData, new FileUserDataProvider(Schemas.file, diskFileSystemProvider, Schemas.vscodeUserData, userDataProfilesService, uriIdentityService, logService));
// Policy
const policyService = isWindows && productService.win32RegValueName ? this._register(new NativePolicyService(logService, productService.win32RegValueName))
: environmentService.policyFile ? this._register(new FilePolicyService(environmentService.policyFile, fileService, logService))
: new NullPolicyService();
let policyService: IPolicyService | undefined;
if (isWindows && productService.win32RegValueName) {
policyService = this._register(new NativePolicyService(logService, productService.win32RegValueName));
} else if (isMacintosh && productService.darwinBundleIdentifier) {
policyService = this._register(new NativePolicyService(logService, productService.darwinBundleIdentifier));
} else if (environmentService.policyFile) {
policyService = this._register(new FilePolicyService(environmentService.policyFile, fileService, logService));
} else {
policyService = new NullPolicyService();
}
services.set(IPolicyService, policyService);
// Configuration
@@ -208,6 +218,7 @@ class CliMain extends Disposable {
services.set(IExtensionSignatureVerificationService, new SyncDescriptor(ExtensionSignatureVerificationService, undefined, true));
services.set(IAllowedExtensionsService, new SyncDescriptor(AllowedExtensionsService, undefined, true));
services.set(INativeServerExtensionManagementService, new SyncDescriptor(ExtensionManagementService, undefined, true));
services.set(IExtensionGalleryManifestService, new SyncDescriptor(ExtensionGalleryManifestService));
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryServiceWithNoStorageService, undefined, true));
// Localizations
@@ -304,6 +315,11 @@ class CliMain extends Disposable {
return instantiationService.createInstance(ExtensionManagementCLI, new ConsoleLogger(LogLevel.Info, false)).locateExtension(this.argv['locate-extension']);
}
// Install MCP server
else if (this.argv['add-mcp']) {
return instantiationService.createInstance(McpManagementCli, new ConsoleLogger(LogLevel.Info, false)).addMcpDefinitions(this.argv['add-mcp']);
}
// Telemetry
else if (this.argv['telemetry']) {
console.log(await buildTelemetryMessage(environmentService.appRoot, environmentService.extensionsPath));