mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 3a6dcb42008d509900b3a3b2d695564eeb4dbdac (#5098)
This commit is contained in:
@@ -55,7 +55,7 @@ export class OpenerService implements IOpenerService {
|
||||
|
||||
if (equalsIgnoreCase(scheme, Schemas.http) || equalsIgnoreCase(scheme, Schemas.https) || equalsIgnoreCase(scheme, Schemas.mailto)) {
|
||||
// open http or default mail application
|
||||
dom.windowOpenNoOpener(resource.toString(true));
|
||||
dom.windowOpenNoOpener(encodeURI(resource.toString(true)));
|
||||
return Promise.resolve(true);
|
||||
|
||||
} else if (equalsIgnoreCase(scheme, Schemas.command)) {
|
||||
|
||||
@@ -1288,6 +1288,7 @@ export interface CommentThread2 {
|
||||
onDidChangeRange: Event<IRange>;
|
||||
onDidChangeLabel: Event<string>;
|
||||
onDidChangeCollasibleState: Event<CommentThreadCollapsibleState | undefined>;
|
||||
isDisposed: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1312,6 +1313,7 @@ export interface CommentThread {
|
||||
comments: Comment[] | undefined;
|
||||
collapsibleState?: CommentThreadCollapsibleState;
|
||||
reply?: Command;
|
||||
isDisposed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -399,7 +399,7 @@ export abstract class BaseEditorSimpleWorker {
|
||||
|
||||
// ---- BEGIN minimal edits ---------------------------------------------------------------
|
||||
|
||||
private static readonly _diffLimit = 10000;
|
||||
private static readonly _diffLimit = 100000;
|
||||
|
||||
public computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): Promise<TextEdit[]> {
|
||||
const model = this._getModel(modelUrl);
|
||||
@@ -432,7 +432,7 @@ export abstract class BaseEditorSimpleWorker {
|
||||
}
|
||||
|
||||
const original = model.getValueInRange(range);
|
||||
text = text!.replace(/\r\n|\n|\r/g, model.eol);
|
||||
text = text.replace(/\r\n|\n|\r/g, model.eol);
|
||||
|
||||
if (original === text) {
|
||||
// noop
|
||||
|
||||
@@ -21,6 +21,8 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { regExpFlags } from 'vs/base/common/strings';
|
||||
import { isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { StopWatch } from 'vs/base/common/stopwatch';
|
||||
|
||||
/**
|
||||
* Stop syncing a model to the worker if it was not needed for 1 min.
|
||||
@@ -48,14 +50,16 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker
|
||||
|
||||
private readonly _modelService: IModelService;
|
||||
private readonly _workerManager: WorkerManager;
|
||||
|
||||
private readonly _logService: ILogService;
|
||||
constructor(
|
||||
@IModelService modelService: IModelService,
|
||||
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService
|
||||
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super();
|
||||
this._modelService = modelService;
|
||||
this._workerManager = this._register(new WorkerManager(this._modelService));
|
||||
this._logService = logService;
|
||||
|
||||
// todo@joh make sure this happens only once
|
||||
this._register(modes.LinkProviderRegistry.register('*', {
|
||||
@@ -96,7 +100,10 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker
|
||||
if (!canSyncModel(this._modelService, resource)) {
|
||||
return Promise.resolve(edits); // File too large
|
||||
}
|
||||
return this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits));
|
||||
const sw = StopWatch.create(true);
|
||||
const result = this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits));
|
||||
result.finally(() => this._logService.trace('FORMAT#computeMoreMinimalEdits', resource.toString(true), sw.elapsed()));
|
||||
return result;
|
||||
|
||||
} else {
|
||||
return Promise.resolve(undefined);
|
||||
|
||||
@@ -145,8 +145,6 @@ export module StaticServices {
|
||||
|
||||
export const markerDecorationsService = define(IMarkerDecorationsService, (o) => new MarkerDecorationsService(modelService.get(o), markerService.get(o)));
|
||||
|
||||
export const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), resourceConfigurationService.get(o)));
|
||||
|
||||
export const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl());
|
||||
|
||||
export const codeEditorService = define(ICodeEditorService, (o) => new StandaloneCodeEditorServiceImpl(standaloneThemeService.get(o)));
|
||||
@@ -157,6 +155,8 @@ export module StaticServices {
|
||||
|
||||
export const logService = define(ILogService, () => new NullLogService());
|
||||
|
||||
export const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), resourceConfigurationService.get(o), logService.get(o)));
|
||||
|
||||
export const suggestMemoryService = define(ISuggestMemoryService, (o) => new SuggestMemoryService(storageService.get(o), configurationService.get(o)));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user