From 18b97d9d367d5fc1533c48157ebca7bb18b62e3c Mon Sep 17 00:00:00 2001 From: Veetaha Date: Tue, 25 Feb 2020 01:43:52 +0200 Subject: vscode: migrate rust-analyzer-api to import * as lc as per matklad and kjeremy --- editors/code/src/rust-analyzer-api.ts | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/rust-analyzer-api.ts b/editors/code/src/rust-analyzer-api.ts index d2738fef3..c5a010e94 100644 --- a/editors/code/src/rust-analyzer-api.ts +++ b/editors/code/src/rust-analyzer-api.ts @@ -2,17 +2,17 @@ * This file mirrors `crates/rust-analyzer/src/req.rs` declarations. */ -import { RequestType, TextDocumentIdentifier, Position, Range, TextDocumentPositionParams, Location, NotificationType, WorkspaceEdit } from "vscode-languageclient"; +import * as lc from "vscode-languageclient"; type Option = null | T; type Vec = T[]; type FxHashMap = Record; function request(method: string) { - return new RequestType(`rust-analyzer/${method}`); + return new lc.RequestType(`rust-analyzer/${method}`); } function notification(method: string) { - return new NotificationType(method); + return new lc.NotificationType(method); } @@ -23,15 +23,15 @@ export const collectGarbage = request("collectGarbage"); export interface SyntaxTreeParams { - textDocument: TextDocumentIdentifier; - range: Option; + textDocument: lc.TextDocumentIdentifier; + range: Option; } export const syntaxTree = request("syntaxTree"); export interface ExpandMacroParams { - textDocument: TextDocumentIdentifier; - position: Option; + textDocument: lc.TextDocumentIdentifier; + position: Option; } export interface ExpandedMacro { name: string; @@ -41,10 +41,10 @@ export const expandMacro = request>("ex export interface FindMatchingBraceParams { - textDocument: TextDocumentIdentifier; - offsets: Vec; + textDocument: lc.TextDocumentIdentifier; + offsets: Vec; } -export const findMatchingBrace = request>("findMatchingBrace"); +export const findMatchingBrace = request>("findMatchingBrace"); export interface PublishDecorationsParams { @@ -52,31 +52,31 @@ export interface PublishDecorationsParams { decorations: Vec; } export interface Decoration { - range: Range; + range: lc.Range; tag: string; bindingHash: Option; } -export const decorationsRequest = request>("decorationsRequest"); +export const decorationsRequest = request>("decorationsRequest"); -export const parentModule = request>("parentModule"); +export const parentModule = request>("parentModule"); export interface JoinLinesParams { - textDocument: TextDocumentIdentifier; - range: Range; + textDocument: lc.TextDocumentIdentifier; + range: lc.Range; } export const joinLines = request("joinLines"); -export const onEnter = request>("onEnter"); +export const onEnter = request>("onEnter"); export interface RunnablesParams { - textDocument: TextDocumentIdentifier; - position: Option; + textDocument: lc.TextDocumentIdentifier; + position: Option; } export interface Runnable { - range: Range; + range: lc.Range; label: string; bin: string; args: Vec; @@ -91,12 +91,12 @@ export const enum InlayKind { ParameterHint = "ParameterHint", } export interface InlayHint { - range: Range; + range: lc.Range; kind: InlayKind; label: string; } export interface InlayHintsParams { - textDocument: TextDocumentIdentifier; + textDocument: lc.TextDocumentIdentifier; } export const inlayHints = request>("inlayHints"); @@ -112,6 +112,6 @@ export const publishDecorations = notification("publis export interface SourceChange { label: string; - workspaceEdit: WorkspaceEdit; - cursorPosition: Option; + workspaceEdit: lc.WorkspaceEdit; + cursorPosition: Option; } -- cgit v1.2.3