mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)
This commit is contained in:
@@ -8,7 +8,6 @@ import { domContentLoaded, addDisposableListener, EventType, addClass } from 'vs
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { SimpleLogService } from 'vs/workbench/browser/web.simpleservices';
|
||||
import { BrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import { Workbench } from 'vs/workbench/browser/workbench';
|
||||
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
@@ -42,6 +41,10 @@ import { getThemeTypeSelector, DARK, HIGH_CONTRAST, LIGHT } from 'vs/platform/th
|
||||
import { InMemoryUserDataProvider } from 'vs/workbench/services/userData/common/inMemoryUserDataProvider';
|
||||
import { registerWindowDriver } from 'vs/platform/driver/browser/driver';
|
||||
import { StaticExtensionsService, IStaticExtensionsService } from 'vs/workbench/services/extensions/common/staticExtensions';
|
||||
import { BufferLogService } from 'vs/platform/log/common/bufferLog';
|
||||
import { FileLogService } from 'vs/platform/log/common/fileLogService';
|
||||
import { toLocalISOString } from 'vs/base/common/date';
|
||||
import { INDEXEDDB_LOG_SCHEME, IndexedDBLogProvider } from 'vs/workbench/services/log/browser/indexedDBLogProvider';
|
||||
|
||||
class CodeRendererMain extends Disposable {
|
||||
|
||||
@@ -117,13 +120,14 @@ class CodeRendererMain extends Disposable {
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// Log
|
||||
const logService = new SimpleLogService();
|
||||
const logsPath = URI.file(toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')).with({ scheme: INDEXEDDB_LOG_SCHEME });
|
||||
const logService = new BufferLogService();
|
||||
serviceCollection.set(ILogService, logService);
|
||||
|
||||
const payload = await this.resolveWorkspaceInitializationPayload();
|
||||
|
||||
// Environment
|
||||
const environmentService = new BrowserWorkbenchEnvironmentService(payload.id, this.configuration);
|
||||
const environmentService = new BrowserWorkbenchEnvironmentService({ workspaceId: payload.id, logsPath, ...this.configuration });
|
||||
serviceCollection.set(IWorkbenchEnvironmentService, environmentService);
|
||||
|
||||
// Product
|
||||
@@ -146,6 +150,10 @@ class CodeRendererMain extends Disposable {
|
||||
const fileService = this._register(new FileService(logService));
|
||||
serviceCollection.set(IFileService, fileService);
|
||||
|
||||
// Logger
|
||||
fileService.registerProvider(INDEXEDDB_LOG_SCHEME, new IndexedDBLogProvider());
|
||||
logService.logger = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService);
|
||||
|
||||
// Static Extensions
|
||||
const staticExtensions = new StaticExtensionsService(this.configuration.staticExtensions || []);
|
||||
serviceCollection.set(IStaticExtensionsService, staticExtensions);
|
||||
|
||||
@@ -8,10 +8,9 @@ import * as browser from 'vs/base/browser/browser';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IURLHandler, IURLService } from 'vs/platform/url/common/url';
|
||||
import { ConsoleLogService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IUpdateService, State } from 'vs/platform/update/common/update';
|
||||
@@ -31,7 +30,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { toStoreData, restoreRecentlyOpened } from 'vs/platform/history/common/historyStorage';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IProductService } from 'vs/platform/product/common/product';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
@@ -40,55 +38,6 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
// tslint:disable-next-line: import-patterns
|
||||
import { IWorkspaceStatsService, Tags } from 'vs/workbench/contrib/stats/common/workspaceStats';
|
||||
|
||||
//#region Extension Tips
|
||||
|
||||
export class SimpleExtensionTipsService implements IExtensionTipsService {
|
||||
_serviceBrand: any;
|
||||
|
||||
onRecommendationChange = Event.None;
|
||||
|
||||
getAllRecommendationsWithReason(): { [id: string]: { reasonId: ExtensionRecommendationReason; reasonText: string; }; } {
|
||||
return Object.create(null);
|
||||
}
|
||||
|
||||
getFileBasedRecommendations(): IExtensionRecommendation[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
getOtherRecommendations(): Promise<IExtensionRecommendation[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
getWorkspaceRecommendations(): Promise<IExtensionRecommendation[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
getKeymapRecommendations(): IExtensionRecommendation[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
toggleIgnoredRecommendation(extensionId: string, shouldIgnore: boolean): void {
|
||||
}
|
||||
|
||||
getAllIgnoredRecommendations(): { global: string[]; workspace: string[]; } {
|
||||
return { global: [], workspace: [] };
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
getRecommendedExtensionsByScenario(scenarioType: string): Promise<IExtensionRecommendation[]> {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
promptRecommendedExtensionsByScenario(scenarioType: string): void {
|
||||
return;
|
||||
}
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
}
|
||||
|
||||
registerSingleton(IExtensionTipsService, SimpleExtensionTipsService, true);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Extension URL Handler
|
||||
|
||||
export const IExtensionUrlHandler = createDecorator<IExtensionUrlHandler>('inactiveExtensionUrlHandler');
|
||||
@@ -112,12 +61,6 @@ registerSingleton(IExtensionUrlHandler, SimpleExtensionURLHandler, true);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Log
|
||||
|
||||
export class SimpleLogService extends ConsoleLogService { }
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Update
|
||||
|
||||
export class SimpleUpdateService implements IUpdateService {
|
||||
@@ -192,7 +135,6 @@ export class SimpleWindowService extends Disposable implements IWindowService {
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -388,7 +330,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
|
||||
for (let i = 0; i < _uris.length; i++) {
|
||||
const uri = _uris[i];
|
||||
if ('folderUri' in uri) {
|
||||
const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}${this.workbenchEnvironmentService.configuration.connectionToken ? `&tkn=${this.workbenchEnvironmentService.configuration.connectionToken}` : ''}`;
|
||||
const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}`;
|
||||
if (openFolderInNewWindow) {
|
||||
window.open(newAddress);
|
||||
} else {
|
||||
@@ -475,7 +417,6 @@ export class SimpleWindowsService implements IWindowsService {
|
||||
readonly onRecentlyOpenedChange: Event<void> = Event.None;
|
||||
|
||||
constructor(
|
||||
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService,
|
||||
@IDialogService private readonly dialogService: IDialogService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IClipboardService private readonly clipboardService: IClipboardService
|
||||
@@ -667,11 +608,6 @@ export class SimpleWindowsService implements IWindowsService {
|
||||
addQueryParameter('ibe', ibe);
|
||||
}
|
||||
|
||||
// add connection token
|
||||
if (this.workbenchEnvironmentService.configuration.connectionToken) {
|
||||
addQueryParameter('tkn', this.workbenchEnvironmentService.configuration.connectionToken);
|
||||
}
|
||||
|
||||
window.open(newAddress);
|
||||
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user