mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +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
|
@ -5,13 +5,20 @@ import { Server } from '../server';
|
|||
|
||||
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: TextDocumentIdentifier = {
|
||||
uri: editor.document.uri.toString(),
|
||||
uri: editor.document.uri.toString()
|
||||
};
|
||||
const response = await Server.client.sendRequest<Location[]>('m/parentModule', request);
|
||||
const response = await Server.client.sendRequest<Location[]>(
|
||||
'm/parentModule',
|
||||
request
|
||||
);
|
||||
const loc = response[0];
|
||||
if (loc == null) { return; }
|
||||
if (loc == null) {
|
||||
return;
|
||||
}
|
||||
const uri = Server.client.protocol2CodeConverter.asUri(loc.uri);
|
||||
const range = Server.client.protocol2CodeConverter.asRange(loc.range);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue