mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 0f73473c08055054f317c1c94502f7f39fdbb164 (#6892)
* Merge from vscode 0f73473c08055054f317c1c94502f7f39fdbb164 * fix tslinting
This commit is contained in:
@@ -617,10 +617,13 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
// To properly reset line numbers we need to read the configuration for each editor respecting it's uri.
|
||||
if (!lineNumbers && isCodeEditor(editor) && editor.hasModel()) {
|
||||
const model = editor.getModel();
|
||||
this.configurationService.getValue('editor.lineNumbers', { resource: model.uri });
|
||||
} else {
|
||||
editor.updateOptions({ lineNumbers });
|
||||
lineNumbers = this.configurationService.getValue('editor.lineNumbers', { resource: model.uri });
|
||||
}
|
||||
if (!lineNumbers) {
|
||||
lineNumbers = this.configurationService.getValue('editor.lineNumbers');
|
||||
}
|
||||
|
||||
editor.updateOptions({ lineNumbers });
|
||||
});
|
||||
|
||||
// Check if zen mode transitioned to full screen and if now we are out of zen mode
|
||||
@@ -1292,4 +1295,3 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
this.disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -999,7 +999,7 @@ export class ChangeModeAction extends Action {
|
||||
private configureFileAssociation(resource: URI): void {
|
||||
const extension = extname(resource);
|
||||
const base = basename(resource);
|
||||
const currentAssociation = this.modeService.getModeIdByFilepathOrFirstLine(resource.with({ path: base }));
|
||||
const currentAssociation = this.modeService.getModeIdByFilepathOrFirstLine(URI.file(base));
|
||||
|
||||
const languages = this.modeService.getRegisteredLanguageNames();
|
||||
const picks: IQuickPickItem[] = languages.sort().map((lang, index) => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { mark } from 'vs/base/common/performance';
|
||||
import { domContentLoaded, addDisposableListener, EventType, addClass } from 'vs/base/browser/dom';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILogService, ConsoleLogService, MultiplexLogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { BrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import { Workbench } from 'vs/workbench/browser/workbench';
|
||||
@@ -44,7 +44,8 @@ import { StaticExtensionsService, IStaticExtensionsService } from 'vs/workbench/
|
||||
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';
|
||||
import { IndexedDBLogProvider } from 'vs/workbench/services/log/browser/indexedDBLogProvider';
|
||||
import { InMemoryLogProvider } from 'vs/workbench/services/log/common/inMemoryLogProvider';
|
||||
|
||||
class CodeRendererMain extends Disposable {
|
||||
|
||||
@@ -120,7 +121,7 @@ class CodeRendererMain extends Disposable {
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// Log
|
||||
const logsPath = URI.file(toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')).with({ scheme: INDEXEDDB_LOG_SCHEME });
|
||||
const logsPath = URI.file(toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')).with({ scheme: 'vscode-log' });
|
||||
const logService = new BufferLogService();
|
||||
serviceCollection.set(ILogService, logService);
|
||||
|
||||
@@ -151,8 +152,19 @@ class CodeRendererMain extends Disposable {
|
||||
serviceCollection.set(IFileService, fileService);
|
||||
|
||||
// Logger
|
||||
fileService.registerProvider(INDEXEDDB_LOG_SCHEME, new IndexedDBLogProvider());
|
||||
logService.logger = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService);
|
||||
const indexedDBLogProvider = new IndexedDBLogProvider(logsPath.scheme);
|
||||
indexedDBLogProvider.database.then(
|
||||
() => fileService.registerProvider(logsPath.scheme, indexedDBLogProvider),
|
||||
e => {
|
||||
(<ILogService>logService).info('Error while creating indexedDB log provider. Falling back to in-memory log provider.');
|
||||
(<ILogService>logService).error(e);
|
||||
fileService.registerProvider(logsPath.scheme, new InMemoryLogProvider(logsPath.scheme));
|
||||
}
|
||||
).then(() => {
|
||||
const consoleLogService = new ConsoleLogService(logService.getLevel());
|
||||
const fileLogService = new FileLogService('window', environmentService.logFile, logService.getLevel(), fileService);
|
||||
logService.logger = new MultiplexLogService([consoleLogService, fileLogService]);
|
||||
});
|
||||
|
||||
// Static Extensions
|
||||
const staticExtensions = new StaticExtensionsService(this.configuration.staticExtensions || []);
|
||||
|
||||
@@ -7,11 +7,8 @@ import { URI } from 'vs/base/common/uri';
|
||||
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 { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IURLHandler, IURLService } from 'vs/platform/url/common/url';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IUpdateService, State } from 'vs/platform/update/common/update';
|
||||
import { IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IURIToOpen, IMessageBoxResult, IWindowsService, IOpenSettings, IWindowSettings } from 'vs/platform/windows/common/windows';
|
||||
@@ -20,7 +17,6 @@ import { IRecentlyOpened, IRecent, isRecentFile, isRecentFolder } from 'vs/platf
|
||||
import { ISerializableCommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
|
||||
import { ITunnelService } from 'vs/platform/remote/common/tunnel';
|
||||
// tslint:disable-next-line: import-patterns
|
||||
import { IWorkspaceContextService, WorkbenchState, IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { addDisposableListener, EventType, windowOpenNoOpener } from 'vs/base/browser/dom';
|
||||
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -38,29 +34,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 URL Handler
|
||||
|
||||
export const IExtensionUrlHandler = createDecorator<IExtensionUrlHandler>('inactiveExtensionUrlHandler');
|
||||
|
||||
export interface IExtensionUrlHandler {
|
||||
readonly _serviceBrand: any;
|
||||
registerExtensionHandler(extensionId: ExtensionIdentifier, handler: IURLHandler): void;
|
||||
unregisterExtensionHandler(extensionId: ExtensionIdentifier): void;
|
||||
}
|
||||
|
||||
export class SimpleExtensionURLHandler implements IExtensionUrlHandler {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
registerExtensionHandler(extensionId: ExtensionIdentifier, handler: IURLHandler): void { }
|
||||
|
||||
unregisterExtensionHandler(extensionId: ExtensionIdentifier): void { }
|
||||
}
|
||||
|
||||
registerSingleton(IExtensionUrlHandler, SimpleExtensionURLHandler, true);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Update
|
||||
|
||||
export class SimpleUpdateService implements IUpdateService {
|
||||
@@ -95,24 +68,6 @@ registerSingleton(IUpdateService, SimpleUpdateService);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region URL
|
||||
|
||||
export class SimpleURLService implements IURLService {
|
||||
_serviceBrand: any;
|
||||
|
||||
open(url: URI): Promise<boolean> {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
registerHandler(handler: IURLHandler): IDisposable {
|
||||
return Disposable.None;
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IURLService, SimpleURLService);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Window
|
||||
|
||||
export class SimpleWindowService extends Disposable implements IWindowService {
|
||||
|
||||
Reference in New Issue
Block a user