mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
editor/code: Re-apply code format
This commit is contained in:
parent
9d06aa55b4
commit
f7823f3106
17 changed files with 180 additions and 175 deletions
|
@ -17,7 +17,9 @@ export async function applySnippetWorkspaceEdit(edit: vscode.WorkspaceEdit) {
|
|||
for (const indel of edits) {
|
||||
assert(
|
||||
!parseSnippet(indel.newText),
|
||||
`bad ws edit: snippet received with multiple edits: ${JSON.stringify(edit)}`
|
||||
`bad ws edit: snippet received with multiple edits: ${JSON.stringify(
|
||||
edit,
|
||||
)}`,
|
||||
);
|
||||
builder.replace(indel.range, indel.newText);
|
||||
}
|
||||
|
@ -32,7 +34,7 @@ async function editorFromUri(uri: vscode.Uri): Promise<vscode.TextEditor | undef
|
|||
await vscode.window.showTextDocument(uri, {});
|
||||
}
|
||||
return vscode.window.visibleTextEditors.find(
|
||||
(it) => it.document.uri.toString() === uri.toString()
|
||||
(it) => it.document.uri.toString() === uri.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -56,8 +58,8 @@ export async function applySnippetTextEdits(editor: vscode.TextEditor, edits: vs
|
|||
selections.push(
|
||||
new vscode.Selection(
|
||||
new vscode.Position(startLine, startColumn),
|
||||
new vscode.Position(startLine, endColumn)
|
||||
)
|
||||
new vscode.Position(startLine, endColumn),
|
||||
),
|
||||
);
|
||||
builder.replace(indel.range, newText);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue