diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-10-07 21:59:02 +0100 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-10-07 22:12:40 +0100 |
commit | 4d62cfccbb8281f33b6f894df07e7316a9d45bfb (patch) | |
tree | 56ad69cb2f5c1096a2a74cfa078b92c40fe902e1 /editors/code/src/commands/parent_module.ts | |
parent | 69de7e2fd71c3a808f0ac856d7b105eeb210f169 (diff) |
Apply tslint suggestions, round one
Diffstat (limited to 'editors/code/src/commands/parent_module.ts')
-rw-r--r-- | editors/code/src/commands/parent_module.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts index dae60bfb4..7d413c27a 100644 --- a/editors/code/src/commands/parent_module.ts +++ b/editors/code/src/commands/parent_module.ts | |||
@@ -1,22 +1,22 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | 2 | ||
3 | import { TextDocumentIdentifier, Location } from "vscode-languageclient"; | 3 | import { Location, TextDocumentIdentifier } from 'vscode-languageclient'; |
4 | import { Server } from '../server'; | 4 | import { Server } from '../server'; |
5 | 5 | ||
6 | export async function handle() { | 6 | export async function handle() { |
7 | let editor = vscode.window.activeTextEditor | 7 | const editor = vscode.window.activeTextEditor; |
8 | if (editor == null || editor.document.languageId != "rust") return | 8 | if (editor == null || editor.document.languageId != 'rust') { return; } |
9 | let request: TextDocumentIdentifier = { | 9 | const request: TextDocumentIdentifier = { |
10 | uri: editor.document.uri.toString() | 10 | uri: editor.document.uri.toString(), |
11 | } | 11 | }; |
12 | let response = await Server.client.sendRequest<Location[]>("m/parentModule", request) | 12 | const response = await Server.client.sendRequest<Location[]>('m/parentModule', request); |
13 | let loc = response[0] | 13 | const loc = response[0]; |
14 | if (loc == null) return | 14 | if (loc == null) { return; } |
15 | let uri = Server.client.protocol2CodeConverter.asUri(loc.uri) | 15 | const uri = Server.client.protocol2CodeConverter.asUri(loc.uri); |
16 | let range = Server.client.protocol2CodeConverter.asRange(loc.range) | 16 | const range = Server.client.protocol2CodeConverter.asRange(loc.range); |
17 | 17 | ||
18 | let doc = await vscode.workspace.openTextDocument(uri) | 18 | const doc = await vscode.workspace.openTextDocument(uri); |
19 | let e = await vscode.window.showTextDocument(doc) | 19 | const e = await vscode.window.showTextDocument(doc); |
20 | e.selection = new vscode.Selection(range.start, range.start) | 20 | e.selection = new vscode.Selection(range.start, range.start); |
21 | e.revealRange(range, vscode.TextEditorRevealType.InCenter) | 21 | e.revealRange(range, vscode.TextEditorRevealType.InCenter); |
22 | } | 22 | } |