22 * This file mirrors `crates/rust-analyzer/src/req.rs` declarations.
33 */
44
5- import { RequestType , TextDocumentIdentifier , Position , Range , TextDocumentPositionParams , Location , NotificationType , WorkspaceEdit } from "vscode-languageclient" ;
5+ import * as lc from "vscode-languageclient" ;
66
77type Option < T > = null | T ;
88type Vec < T > = T [ ] ;
99type FxHashMap < K extends PropertyKey , V > = Record < K , V > ;
1010
1111function request < TParams , TResult > ( method : string ) {
12- return new RequestType < TParams , TResult , unknown > ( `rust-analyzer/${ method } ` ) ;
12+ return new lc . RequestType < TParams , TResult , unknown > ( `rust-analyzer/${ method } ` ) ;
1313}
1414function notification < TParam > ( method : string ) {
15- return new NotificationType < TParam > ( method ) ;
15+ return new lc . NotificationType < TParam > ( method ) ;
1616}
1717
1818
@@ -23,15 +23,15 @@ export const collectGarbage = request<null, null>("collectGarbage");
2323
2424
2525export interface SyntaxTreeParams {
26- textDocument : TextDocumentIdentifier ;
27- range : Option < Range > ;
26+ textDocument : lc . TextDocumentIdentifier ;
27+ range : Option < lc . Range > ;
2828}
2929export const syntaxTree = request < SyntaxTreeParams , string > ( "syntaxTree" ) ;
3030
3131
3232export interface ExpandMacroParams {
33- textDocument : TextDocumentIdentifier ;
34- position : Option < Position > ;
33+ textDocument : lc . TextDocumentIdentifier ;
34+ position : Option < lc . Position > ;
3535}
3636export interface ExpandedMacro {
3737 name : string ;
@@ -41,42 +41,42 @@ export const expandMacro = request<ExpandMacroParams, Option<ExpandedMacro>>("ex
4141
4242
4343export interface FindMatchingBraceParams {
44- textDocument : TextDocumentIdentifier ;
45- offsets : Vec < Position > ;
44+ textDocument : lc . TextDocumentIdentifier ;
45+ offsets : Vec < lc . Position > ;
4646}
47- export const findMatchingBrace = request < FindMatchingBraceParams , Vec < Position > > ( "findMatchingBrace" ) ;
47+ export const findMatchingBrace = request < FindMatchingBraceParams , Vec < lc . Position > > ( "findMatchingBrace" ) ;
4848
4949
5050export interface PublishDecorationsParams {
5151 uri : string ;
5252 decorations : Vec < Decoration > ;
5353}
5454export interface Decoration {
55- range : Range ;
55+ range : lc . Range ;
5656 tag : string ;
5757 bindingHash : Option < string > ;
5858}
59- export const decorationsRequest = request < TextDocumentIdentifier , Vec < Decoration > > ( "decorationsRequest" ) ;
59+ export const decorationsRequest = request < lc . TextDocumentIdentifier , Vec < Decoration > > ( "decorationsRequest" ) ;
6060
6161
62- export const parentModule = request < TextDocumentPositionParams , Vec < Location > > ( "parentModule" ) ;
62+ export const parentModule = request < lc . TextDocumentPositionParams , Vec < lc . Location > > ( "parentModule" ) ;
6363
6464
6565export interface JoinLinesParams {
66- textDocument : TextDocumentIdentifier ;
67- range : Range ;
66+ textDocument : lc . TextDocumentIdentifier ;
67+ range : lc . Range ;
6868}
6969export const joinLines = request < JoinLinesParams , SourceChange > ( "joinLines" ) ;
7070
7171
72- export const onEnter = request < TextDocumentPositionParams , Option < SourceChange > > ( "onEnter" ) ;
72+ export const onEnter = request < lc . TextDocumentPositionParams , Option < SourceChange > > ( "onEnter" ) ;
7373
7474export interface RunnablesParams {
75- textDocument : TextDocumentIdentifier ;
76- position : Option < Position > ;
75+ textDocument : lc . TextDocumentIdentifier ;
76+ position : Option < lc . Position > ;
7777}
7878export interface Runnable {
79- range : Range ;
79+ range : lc . Range ;
8080 label : string ;
8181 bin : string ;
8282 args : Vec < string > ;
@@ -91,12 +91,12 @@ export const enum InlayKind {
9191 ParameterHint = "ParameterHint" ,
9292}
9393export interface InlayHint {
94- range : Range ;
94+ range : lc . Range ;
9595 kind : InlayKind ;
9696 label : string ;
9797}
9898export interface InlayHintsParams {
99- textDocument : TextDocumentIdentifier ;
99+ textDocument : lc . TextDocumentIdentifier ;
100100}
101101export const inlayHints = request < InlayHintsParams , Vec < InlayHint > > ( "inlayHints" ) ;
102102
@@ -112,6 +112,6 @@ export const publishDecorations = notification<PublishDecorationsParams>("publis
112112
113113export interface SourceChange {
114114 label : string ;
115- workspaceEdit : WorkspaceEdit ;
116- cursorPosition : Option < TextDocumentPositionParams > ;
115+ workspaceEdit : lc . WorkspaceEdit ;
116+ cursorPosition : Option < lc . TextDocumentPositionParams > ;
117117}
0 commit comments