mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
add TextEdit#newEol, adopt for workspace edit and onWillSave-event
This commit is contained in:
@@ -8,9 +8,9 @@ import URI from 'vs/base/common/uri';
|
||||
import { normalize } from 'vs/base/common/paths';
|
||||
import { relative } from 'path';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IResourceTextEdit } from 'vs/editor/common/services/bulkEdit';
|
||||
import { IResourceEdit } from 'vs/editor/common/services/bulkEdit';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { fromRange } from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import { fromRange, EndOfLine } from 'vs/workbench/api/node/extHostTypeConverters';
|
||||
import { MainContext, MainThreadWorkspaceShape } from './extHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
@@ -70,7 +70,7 @@ export class ExtHostWorkspace {
|
||||
|
||||
appyEdit(edit: vscode.WorkspaceEdit): TPromise<boolean> {
|
||||
|
||||
let resourceEdits: IResourceTextEdit[] = [];
|
||||
let resourceEdits: IResourceEdit[] = [];
|
||||
|
||||
let entries = edit.entries();
|
||||
for (let entry of entries) {
|
||||
@@ -80,7 +80,8 @@ export class ExtHostWorkspace {
|
||||
resourceEdits.push({
|
||||
resource: <URI>uri,
|
||||
newText: edit.newText,
|
||||
range: fromRange(edit.range)
|
||||
newEol: EndOfLine.from(edit.newEol),
|
||||
range: edit.range && fromRange(edit.range)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user