diff options
Diffstat (limited to 'editors/code/src/lsp_ext.ts')
-rw-r--r-- | editors/code/src/lsp_ext.ts | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 4da12eb30..5f32cb40e 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts | |||
@@ -5,8 +5,12 @@ | |||
5 | import * as lc from "vscode-languageclient"; | 5 | import * as lc from "vscode-languageclient"; |
6 | 6 | ||
7 | export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus"); | 7 | export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus"); |
8 | export const memoryUsage = new lc.RequestType<null, string, void>("rust-analyzer/memoryUsage"); | ||
8 | 9 | ||
9 | export const collectGarbage = new lc.RequestType<null, null, void>("rust-analyzer/collectGarbage"); | 10 | export type Status = "loading" | "ready" | "invalid" | "needsReload"; |
11 | export const status = new lc.NotificationType<Status>("rust-analyzer/status"); | ||
12 | |||
13 | export const reloadWorkspace = new lc.RequestType<null, null, void>("rust-analyzer/reloadWorkspace"); | ||
10 | 14 | ||
11 | export interface SyntaxTreeParams { | 15 | export interface SyntaxTreeParams { |
12 | textDocument: lc.TextDocumentIdentifier; | 16 | textDocument: lc.TextDocumentIdentifier; |
@@ -33,6 +37,12 @@ export const matchingBrace = new lc.RequestType<MatchingBraceParams, lc.Position | |||
33 | 37 | ||
34 | export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[], void>("experimental/parentModule"); | 38 | export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[], void>("experimental/parentModule"); |
35 | 39 | ||
40 | export interface ResolveCodeActionParams { | ||
41 | id: string; | ||
42 | codeActionParams: lc.CodeActionParams; | ||
43 | } | ||
44 | export const resolveCodeAction = new lc.RequestType<ResolveCodeActionParams, lc.WorkspaceEdit, unknown>('experimental/resolveCodeAction'); | ||
45 | |||
36 | export interface JoinLinesParams { | 46 | export interface JoinLinesParams { |
37 | textDocument: lc.TextDocumentIdentifier; | 47 | textDocument: lc.TextDocumentIdentifier; |
38 | ranges: lc.Range[]; | 48 | ranges: lc.Range[]; |
@@ -45,16 +55,19 @@ export interface RunnablesParams { | |||
45 | textDocument: lc.TextDocumentIdentifier; | 55 | textDocument: lc.TextDocumentIdentifier; |
46 | position: lc.Position | null; | 56 | position: lc.Position | null; |
47 | } | 57 | } |
58 | |||
48 | export interface Runnable { | 59 | export interface Runnable { |
49 | range: lc.Range; | ||
50 | label: string; | 60 | label: string; |
51 | bin: string; | 61 | location?: lc.LocationLink; |
52 | args: string[]; | 62 | kind: "cargo"; |
53 | extraArgs: string[]; | 63 | args: { |
54 | env: { [key: string]: string }; | 64 | workspaceRoot?: string; |
55 | cwd: string | null; | 65 | cargoArgs: string[]; |
66 | executableArgs: string[]; | ||
67 | expectTest?: boolean; | ||
68 | }; | ||
56 | } | 69 | } |
57 | export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("rust-analyzer/runnables"); | 70 | export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("experimental/runnables"); |
58 | 71 | ||
59 | export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint | InlayHint.ChainingHint; | 72 | export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint | InlayHint.ChainingHint; |
60 | 73 | ||
@@ -82,3 +95,15 @@ export interface SsrParams { | |||
82 | parseOnly: boolean; | 95 | parseOnly: boolean; |
83 | } | 96 | } |
84 | export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr'); | 97 | export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr'); |
98 | |||
99 | export interface CommandLink extends lc.Command { | ||
100 | /** | ||
101 | * A tooltip for the command, when represented in the UI. | ||
102 | */ | ||
103 | tooltip?: string; | ||
104 | } | ||
105 | |||
106 | export interface CommandLinkGroup { | ||
107 | title?: string; | ||
108 | commands: CommandLink[]; | ||
109 | } | ||