mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Apply tslint suggestions, round one
This commit is contained in:
parent
69de7e2fd7
commit
4d62cfccbb
16 changed files with 257 additions and 241 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as vscode from 'vscode';
|
||||
|
||||
import { TextDocumentIdentifier, Range } from "vscode-languageclient";
|
||||
import { Range, TextDocumentIdentifier } from 'vscode-languageclient';
|
||||
import { Server } from '../server';
|
||||
import { handle as applySourceChange, SourceChange } from './apply_source_change';
|
||||
|
||||
|
@ -10,12 +10,12 @@ interface JoinLinesParams {
|
|||
}
|
||||
|
||||
export async function handle() {
|
||||
let editor = vscode.window.activeTextEditor
|
||||
if (editor == null || editor.document.languageId != "rust") return
|
||||
let request: JoinLinesParams = {
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor == null || editor.document.languageId != 'rust') { return; }
|
||||
const request: JoinLinesParams = {
|
||||
range: Server.client.code2ProtocolConverter.asRange(editor.selection),
|
||||
}
|
||||
let change = await Server.client.sendRequest<SourceChange>("m/joinLines", request)
|
||||
await applySourceChange(change)
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
};
|
||||
const change = await Server.client.sendRequest<SourceChange>('m/joinLines', request);
|
||||
await applySourceChange(change);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue