mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Run prettier on all files
This commit is contained in:
parent
3a405b65d6
commit
e26071d96e
23 changed files with 220 additions and 129 deletions
|
@ -14,14 +14,19 @@ interface ExtendSelectionResult {
|
|||
|
||||
export async function handle() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor == null || editor.document.languageId !== 'rust') { return; }
|
||||
if (editor == null || editor.document.languageId !== 'rust') {
|
||||
return;
|
||||
}
|
||||
const request: ExtendSelectionParams = {
|
||||
selections: editor.selections.map((s) => {
|
||||
selections: editor.selections.map(s => {
|
||||
return Server.client.code2ProtocolConverter.asRange(s);
|
||||
}),
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
textDocument: { uri: editor.document.uri.toString() }
|
||||
};
|
||||
const response = await Server.client.sendRequest<ExtendSelectionResult>('m/extendSelection', request);
|
||||
const response = await Server.client.sendRequest<ExtendSelectionResult>(
|
||||
'm/extendSelection',
|
||||
request
|
||||
);
|
||||
editor.selections = response.selections.map((range: Range) => {
|
||||
const r = Server.client.protocol2CodeConverter.asRange(range);
|
||||
return new vscode.Selection(r.start, r.end);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue