Apply tslint suggestions, round one

This commit is contained in:
Adolfo Ochagavía 2018-10-07 22:59:02 +02:00
parent 69de7e2fd7
commit 4d62cfccbb
16 changed files with 257 additions and 241 deletions

View file

@ -1,22 +1,22 @@
import * as vscode from 'vscode';
import { TextDocumentIdentifier, Location } from "vscode-languageclient";
import { Location, TextDocumentIdentifier } from 'vscode-languageclient';
import { Server } from '../server';
export async function handle() {
let editor = vscode.window.activeTextEditor
if (editor == null || editor.document.languageId != "rust") return
let request: TextDocumentIdentifier = {
uri: editor.document.uri.toString()
}
let response = await Server.client.sendRequest<Location[]>("m/parentModule", request)
let loc = response[0]
if (loc == null) return
let uri = Server.client.protocol2CodeConverter.asUri(loc.uri)
let range = Server.client.protocol2CodeConverter.asRange(loc.range)
const editor = vscode.window.activeTextEditor;
if (editor == null || editor.document.languageId != 'rust') { return; }
const request: TextDocumentIdentifier = {
uri: editor.document.uri.toString(),
};
const response = await Server.client.sendRequest<Location[]>('m/parentModule', request);
const loc = response[0];
if (loc == null) { return; }
const uri = Server.client.protocol2CodeConverter.asUri(loc.uri);
const range = Server.client.protocol2CodeConverter.asRange(loc.range);
let doc = await vscode.workspace.openTextDocument(uri)
let e = await vscode.window.showTextDocument(doc)
e.selection = new vscode.Selection(range.start, range.start)
e.revealRange(range, vscode.TextEditorRevealType.InCenter)
const doc = await vscode.workspace.openTextDocument(uri);
const e = await vscode.window.showTextDocument(doc);
e.selection = new vscode.Selection(range.start, range.start);
e.revealRange(range, vscode.TextEditorRevealType.InCenter);
}