提交 8fe9f631 编写于 作者: J Johannes Rieken

remove unused argument, #30010

上级 1420d41b
......@@ -344,7 +344,7 @@ export abstract class BaseEditorSimpleWorker {
private static _diffLimit = 10000;
public computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[], ranges: IRange[]): TPromise<TextEdit[]> {
public computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): TPromise<TextEdit[]> {
const model = this._getModel(modelUrl);
if (!model) {
return TPromise.as(edits);
......
......@@ -23,7 +23,7 @@ export interface IEditorWorkerService {
canComputeDirtyDiff(original: URI, modified: URI): boolean;
computeDirtyDiff(original: URI, modified: URI, ignoreTrimWhitespace: boolean): TPromise<IChange[]>;
computeMoreMinimalEdits(resource: URI, edits: TextEdit[], ranges: IRange[]): TPromise<TextEdit[]>;
computeMoreMinimalEdits(resource: URI, edits: TextEdit[]): TPromise<TextEdit[]>;
canNavigateValueSet(resource: URI): boolean;
navigateValueSet(resource: URI, range: IRange, up: boolean): TPromise<IInplaceReplaceSupportResult>;
......
......@@ -90,14 +90,14 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker
return this._workerManager.withWorker().then(client => client.computeDirtyDiff(original, modified, ignoreTrimWhitespace));
}
public computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[], ranges: IRange[]): TPromise<modes.TextEdit[]> {
public computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[]): TPromise<modes.TextEdit[]> {
if (!Array.isArray(edits) || edits.length === 0) {
return TPromise.as(edits);
} else {
if (!canSyncModel(this._modelService, resource)) {
return TPromise.as(edits); // File too large
}
return this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits, ranges));
return this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits));
}
}
......@@ -395,9 +395,9 @@ export class EditorWorkerClient extends Disposable {
});
}
public computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[], ranges: IRange[]): TPromise<modes.TextEdit[]> {
public computeMoreMinimalEdits(resource: URI, edits: modes.TextEdit[]): TPromise<modes.TextEdit[]> {
return this._withSyncedResources([resource]).then(proxy => {
return proxy.computeMoreMinimalEdits(resource.toString(), edits, ranges);
return proxy.computeMoreMinimalEdits(resource.toString(), edits);
});
}
......
......@@ -151,7 +151,7 @@ class FormatOnType implements editorCommon.IEditorContribution {
tabSize: modelOpts.tabSize,
insertSpaces: modelOpts.insertSpaces
}).then(edits => {
return this.workerService.computeMoreMinimalEdits(model.uri, edits, []);
return this.workerService.computeMoreMinimalEdits(model.uri, edits);
}).then(edits => {
unbind.dispose();
......@@ -239,7 +239,7 @@ class FormatOnPaste implements editorCommon.IEditorContribution {
const state = new EditorState(this.editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);
getDocumentRangeFormattingEdits(model, range, { tabSize, insertSpaces }).then(edits => {
return this.workerService.computeMoreMinimalEdits(model.uri, edits, []);
return this.workerService.computeMoreMinimalEdits(model.uri, edits);
}).then(edits => {
if (!state.validate(this.editor) || isFalsyOrEmpty(edits)) {
return;
......@@ -275,7 +275,7 @@ export abstract class AbstractFormatAction extends EditorAction {
const state = new EditorState(editor, CodeEditorStateFlag.Value | CodeEditorStateFlag.Position);
// Receive formatted value from worker
return formattingPromise.then(edits => workerService.computeMoreMinimalEdits(editor.getModel().uri, edits, editor.getSelections())).then(edits => {
return formattingPromise.then(edits => workerService.computeMoreMinimalEdits(editor.getModel().uri, edits)).then(edits => {
if (!state.validate(editor) || isFalsyOrEmpty(edits)) {
return;
}
......
......@@ -88,7 +88,7 @@ suite('EditorSimpleWorker', () => {
test('MoreMinimal', function () {
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: 'This is line One', range: new Range(1, 1, 1, 17) }], []).then(edits => {
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: 'This is line One', range: new Range(1, 1, 1, 17) }]).then(edits => {
assert.equal(edits.length, 1);
const [first] = edits;
assert.equal(first.text, 'O');
......@@ -104,7 +104,7 @@ suite('EditorSimpleWorker', () => {
'}'
], '\n');
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"a":1\r\n}', range: new Range(1, 1, 3, 2) }], []).then(edits => {
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"a":1\r\n}', range: new Range(1, 1, 3, 2) }]).then(edits => {
assert.equal(edits.length, 0);
});
});
......@@ -117,7 +117,7 @@ suite('EditorSimpleWorker', () => {
'}'
], '\n');
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"b":1\r\n}', range: new Range(1, 1, 3, 2) }], []).then(edits => {
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '{\r\n\t"b":1\r\n}', range: new Range(1, 1, 3, 2) }]).then(edits => {
assert.equal(edits.length, 1);
const [first] = edits;
assert.equal(first.text, 'b');
......@@ -133,7 +133,7 @@ suite('EditorSimpleWorker', () => {
'}' // 3
]);
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '\n', range: new Range(3, 2, 4, 1000) }], []).then(edits => {
return worker.computeMoreMinimalEdits(model.uri.toString(), [{ text: '\n', range: new Range(3, 2, 4, 1000) }]).then(edits => {
assert.equal(edits.length, 1);
const [first] = edits;
assert.equal(first.text, '\n');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册