From 4012da07fd22223660a21c65d54d10a9a632eda0 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 19 Nov 2019 22:56:48 +0800 Subject: Change return type of expand_macro --- editors/code/src/commands/expand_macro.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'editors/code/src/commands') diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts index d024a70e0..3fc3e0391 100644 --- a/editors/code/src/commands/expand_macro.ts +++ b/editors/code/src/commands/expand_macro.ts @@ -2,13 +2,16 @@ import * as vscode from 'vscode'; import { Position, TextDocumentIdentifier } from 'vscode-languageclient'; import { Server } from '../server'; -type ExpandMacroResult = [string, string]; +interface ExpandedMacro { + name: string, + expansion: string, +} -function code_format([name, text]: [string, string]): vscode.MarkdownString { +function code_format(expanded: ExpandedMacro): vscode.MarkdownString { const markdown = new vscode.MarkdownString( - `#### Recursive expansion of ${name}! macro` + `#### Recursive expansion of ${expanded.name}! macro` ); - markdown.appendCodeblock(text, 'rust'); + markdown.appendCodeblock(expanded.expansion, 'rust'); return markdown; } @@ -23,7 +26,7 @@ export class ExpandMacroHoverProvider implements vscode.HoverProvider { textDocument: { uri: document.uri.toString() }, position }; - const result = await Server.client.sendRequest( + const result = await Server.client.sendRequest( 'rust-analyzer/expandMacro', request ); -- cgit v1.2.3