aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-11-17 19:39:11 +0000
committerEdwin Cheng <[email protected]>2019-11-19 13:49:06 +0000
commit8010b42b21a59e4bb1e025155b8133ae52d3cf45 (patch)
treef04924bb2a65393cdf0977140e63a888fc90b1a4 /editors/code/src/commands
parentae49a22b5cdd47add478fef6bb8ad3d75338e313 (diff)
Fix npm formatting
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/expand_macro.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts
index bf1923190..d024a70e0 100644
--- a/editors/code/src/commands/expand_macro.ts
+++ b/editors/code/src/commands/expand_macro.ts
@@ -2,11 +2,13 @@ import * as vscode from 'vscode';
2import { Position, TextDocumentIdentifier } from 'vscode-languageclient'; 2import { Position, TextDocumentIdentifier } from 'vscode-languageclient';
3import { Server } from '../server'; 3import { Server } from '../server';
4 4
5type ExpandMacroResult = [string, string] 5type ExpandMacroResult = [string, string];
6 6
7function code_format([name, text]: [string, string]): vscode.MarkdownString { 7function code_format([name, text]: [string, string]): vscode.MarkdownString {
8 const markdown = new vscode.MarkdownString(`#### Recursive expansion of ${name}! macro`); 8 const markdown = new vscode.MarkdownString(
9 markdown.appendCodeblock(text, 'rust'); 9 `#### Recursive expansion of ${name}! macro`
10 );
11 markdown.appendCodeblock(text, 'rust');
10 return markdown; 12 return markdown;
11} 13}
12 14
@@ -14,12 +16,12 @@ export class ExpandMacroHoverProvider implements vscode.HoverProvider {
14 public provideHover( 16 public provideHover(
15 document: vscode.TextDocument, 17 document: vscode.TextDocument,
16 position: vscode.Position, 18 position: vscode.Position,
17 token: vscode.CancellationToken, 19 token: vscode.CancellationToken
18 ): Thenable<vscode.Hover | null> | null { 20 ): Thenable<vscode.Hover | null> | null {
19 async function handle() { 21 async function handle() {
20 const request: MacroExpandParams = { 22 const request: MacroExpandParams = {
21 textDocument: { uri: document.uri.toString() }, 23 textDocument: { uri: document.uri.toString() },
22 position, 24 position
23 }; 25 };
24 const result = await Server.client.sendRequest<ExpandMacroResult>( 26 const result = await Server.client.sendRequest<ExpandMacroResult>(
25 'rust-analyzer/expandMacro', 27 'rust-analyzer/expandMacro',
@@ -31,15 +33,13 @@ export class ExpandMacroHoverProvider implements vscode.HoverProvider {
31 } 33 }
32 34
33 return null; 35 return null;
34 }; 36 }
35 37
36 return handle(); 38 return handle();
37 } 39 }
38} 40}
39 41
40
41interface MacroExpandParams { 42interface MacroExpandParams {
42 textDocument: TextDocumentIdentifier; 43 textDocument: TextDocumentIdentifier;
43 position: Position; 44 position: Position;
44} 45}
45