mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 12:45:39 +01:00
Updates monaco-editor-core & updates changelog.
This commit is contained in:
parent
e2df88093a
commit
c6e59c5f43
7 changed files with 1196 additions and 384 deletions
|
|
@ -627,13 +627,14 @@ function toWorkspaceEdit(edit: lsTypes.WorkspaceEdit | null): languages.Workspac
|
|||
if (!edit || !edit.changes) {
|
||||
return void 0;
|
||||
}
|
||||
let resourceEdits: languages.WorkspaceTextEdit[] = [];
|
||||
let resourceEdits: languages.IWorkspaceTextEdit[] = [];
|
||||
for (let uri in edit.changes) {
|
||||
const _uri = Uri.parse(uri);
|
||||
for (let e of edit.changes[uri]) {
|
||||
resourceEdits.push({
|
||||
resource: _uri,
|
||||
edit: {
|
||||
versionId: undefined,
|
||||
textEdit: {
|
||||
range: toRange(e.range),
|
||||
text: e.newText
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1124,12 +1124,13 @@ export class CodeActionAdaptor extends FormatHelper implements languages.CodeAct
|
|||
context: languages.CodeActionContext,
|
||||
codeFix: ts.CodeFixAction
|
||||
): languages.CodeAction {
|
||||
const edits: languages.WorkspaceTextEdit[] = [];
|
||||
const edits: languages.IWorkspaceTextEdit[] = [];
|
||||
for (const change of codeFix.changes) {
|
||||
for (const textChange of change.textChanges) {
|
||||
edits.push({
|
||||
resource: model.uri,
|
||||
edit: {
|
||||
versionId: undefined,
|
||||
textEdit: {
|
||||
range: this._textSpanToRange(model, textChange.span),
|
||||
text: textChange.newText
|
||||
}
|
||||
|
|
@ -1197,13 +1198,14 @@ export class RenameAdapter extends Adapter implements languages.RenameProvider {
|
|||
return;
|
||||
}
|
||||
|
||||
const edits: languages.WorkspaceTextEdit[] = [];
|
||||
const edits: languages.IWorkspaceTextEdit[] = [];
|
||||
for (const renameLocation of renameLocations) {
|
||||
const model = this._libFiles.getOrCreateModel(renameLocation.fileName);
|
||||
if (model) {
|
||||
edits.push({
|
||||
resource: model.uri,
|
||||
edit: {
|
||||
versionId: undefined,
|
||||
textEdit: {
|
||||
range: this._textSpanToRange(model, renameLocation.textSpan),
|
||||
text: newName
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue