aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/lsp_ext.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/lsp_ext.ts')
-rw-r--r--editors/code/src/lsp_ext.ts41
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 @@
5import * as lc from "vscode-languageclient"; 5import * as lc from "vscode-languageclient";
6 6
7export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus"); 7export const analyzerStatus = new lc.RequestType<null, string, void>("rust-analyzer/analyzerStatus");
8export const memoryUsage = new lc.RequestType<null, string, void>("rust-analyzer/memoryUsage");
8 9
9export const collectGarbage = new lc.RequestType<null, null, void>("rust-analyzer/collectGarbage"); 10export type Status = "loading" | "ready" | "invalid" | "needsReload";
11export const status = new lc.NotificationType<Status>("rust-analyzer/status");
12
13export const reloadWorkspace = new lc.RequestType<null, null, void>("rust-analyzer/reloadWorkspace");
10 14
11export interface SyntaxTreeParams { 15export 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
34export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[], void>("experimental/parentModule"); 38export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[], void>("experimental/parentModule");
35 39
40export interface ResolveCodeActionParams {
41 id: string;
42 codeActionParams: lc.CodeActionParams;
43}
44export const resolveCodeAction = new lc.RequestType<ResolveCodeActionParams, lc.WorkspaceEdit, unknown>('experimental/resolveCodeAction');
45
36export interface JoinLinesParams { 46export 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
48export interface Runnable { 59export 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}
57export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("rust-analyzer/runnables"); 70export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("experimental/runnables");
58 71
59export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint | InlayHint.ChainingHint; 72export 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}
84export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr'); 97export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr');
98
99export interface CommandLink extends lc.Command {
100 /**
101 * A tooltip for the command, when represented in the UI.
102 */
103 tooltip?: string;
104}
105
106export interface CommandLinkGroup {
107 title?: string;
108 commands: CommandLink[];
109}