2020-05-25 12:56:26 +00:00
|
|
|
/**
|
2020-08-28 18:55:24 +00:00
|
|
|
* This file mirrors `crates/rust-analyzer/src/lsp_ext.rs` declarations.
|
2020-05-25 12:56:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import * as lc from "vscode-languageclient";
|
|
|
|
|
2020-09-29 20:05:18 +00:00
|
|
|
export interface AnalyzerStatusParams {
|
|
|
|
textDocument?: lc.TextDocumentIdentifier;
|
|
|
|
}
|
|
|
|
export const analyzerStatus = new lc.RequestType<AnalyzerStatusParams, string, void>("rust-analyzer/analyzerStatus");
|
2020-09-17 10:31:42 +00:00
|
|
|
export const memoryUsage = new lc.RequestType0<string, void>("rust-analyzer/memoryUsage");
|
2021-12-07 14:38:12 +00:00
|
|
|
export const shuffleCrateGraph = new lc.RequestType0<null, void>("rust-analyzer/shuffleCrateGraph");
|
2020-05-25 12:56:26 +00:00
|
|
|
|
2021-04-06 11:16:35 +00:00
|
|
|
export interface ServerStatusParams {
|
2021-04-06 12:50:02 +00:00
|
|
|
health: "ok" | "warning" | "error";
|
|
|
|
quiescent: boolean;
|
|
|
|
message?: string;
|
2020-08-17 11:56:27 +00:00
|
|
|
}
|
2021-04-06 11:16:35 +00:00
|
|
|
export const serverStatus = new lc.NotificationType<ServerStatusParams>("experimental/serverStatus");
|
2020-07-02 10:37:04 +00:00
|
|
|
|
2020-09-17 10:31:42 +00:00
|
|
|
export const reloadWorkspace = new lc.RequestType0<null, void>("rust-analyzer/reloadWorkspace");
|
2020-05-25 12:56:26 +00:00
|
|
|
|
2021-07-26 16:14:14 +00:00
|
|
|
export const hover = new lc.RequestType<HoverParams, lc.Hover | null, void>("textDocument/hover");
|
2021-07-25 21:26:54 +00:00
|
|
|
|
2021-07-26 21:05:59 +00:00
|
|
|
export interface HoverParams extends lc.WorkDoneProgressParams {
|
2021-07-25 21:26:54 +00:00
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
2021-07-26 16:14:14 +00:00
|
|
|
position: lc.Range | lc.Position;
|
2021-07-25 21:26:54 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 12:56:26 +00:00
|
|
|
export interface SyntaxTreeParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
range: lc.Range | null;
|
|
|
|
}
|
|
|
|
export const syntaxTree = new lc.RequestType<SyntaxTreeParams, string, void>("rust-analyzer/syntaxTree");
|
|
|
|
|
2020-12-28 18:29:58 +00:00
|
|
|
export const viewHir = new lc.RequestType<lc.TextDocumentPositionParams, string, void>("rust-analyzer/viewHir");
|
2020-05-25 12:56:26 +00:00
|
|
|
|
2022-03-31 12:50:33 +00:00
|
|
|
export const viewFileText = new lc.RequestType<lc.TextDocumentIdentifier, string, void>("rust-analyzer/viewFileText");
|
|
|
|
|
2021-05-21 21:59:52 +00:00
|
|
|
export interface ViewItemTreeParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const viewItemTree = new lc.RequestType<ViewItemTreeParams, string, void>("rust-analyzer/viewItemTree");
|
|
|
|
|
2021-07-01 22:08:05 +00:00
|
|
|
export interface ViewCrateGraphParams {
|
|
|
|
full: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const viewCrateGraph = new lc.RequestType<ViewCrateGraphParams, string, void>("rust-analyzer/viewCrateGraph");
|
2021-05-11 14:15:31 +00:00
|
|
|
|
2020-05-25 12:56:26 +00:00
|
|
|
export interface ExpandMacroParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
position: lc.Position;
|
|
|
|
}
|
|
|
|
export interface ExpandedMacro {
|
|
|
|
name: string;
|
|
|
|
expansion: string;
|
|
|
|
}
|
|
|
|
export const expandMacro = new lc.RequestType<ExpandMacroParams, ExpandedMacro | null, void>("rust-analyzer/expandMacro");
|
|
|
|
|
|
|
|
export interface MatchingBraceParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
positions: lc.Position[];
|
|
|
|
}
|
|
|
|
export const matchingBrace = new lc.RequestType<MatchingBraceParams, lc.Position[], void>("experimental/matchingBrace");
|
|
|
|
|
2021-10-13 22:16:42 +00:00
|
|
|
export const parentModule = new lc.RequestType<lc.TextDocumentPositionParams, lc.LocationLink[] | null, void>("experimental/parentModule");
|
2020-05-25 12:56:26 +00:00
|
|
|
|
|
|
|
export interface JoinLinesParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
ranges: lc.Range[];
|
|
|
|
}
|
|
|
|
export const joinLines = new lc.RequestType<JoinLinesParams, lc.TextEdit[], void>("experimental/joinLines");
|
|
|
|
|
|
|
|
export const onEnter = new lc.RequestType<lc.TextDocumentPositionParams, lc.TextEdit[], void>("experimental/onEnter");
|
|
|
|
|
|
|
|
export interface RunnablesParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
position: lc.Position | null;
|
|
|
|
}
|
2020-05-31 02:13:08 +00:00
|
|
|
|
2020-05-25 12:56:26 +00:00
|
|
|
export interface Runnable {
|
|
|
|
label: string;
|
2020-06-02 15:22:23 +00:00
|
|
|
location?: lc.LocationLink;
|
|
|
|
kind: "cargo";
|
|
|
|
args: {
|
|
|
|
workspaceRoot?: string;
|
|
|
|
cargoArgs: string[];
|
2020-09-05 13:21:14 +00:00
|
|
|
cargoExtraArgs: string[];
|
2020-06-02 15:22:23 +00:00
|
|
|
executableArgs: string[];
|
2020-06-27 15:53:50 +00:00
|
|
|
expectTest?: boolean;
|
2020-09-05 13:21:14 +00:00
|
|
|
overrideCargo?: string;
|
2020-06-02 15:22:23 +00:00
|
|
|
};
|
2020-05-25 12:56:26 +00:00
|
|
|
}
|
2020-06-02 15:34:18 +00:00
|
|
|
export const runnables = new lc.RequestType<RunnablesParams, Runnable[], void>("experimental/runnables");
|
2020-05-25 12:56:26 +00:00
|
|
|
|
2021-02-27 17:04:43 +00:00
|
|
|
export interface TestInfo {
|
|
|
|
runnable: Runnable;
|
|
|
|
}
|
|
|
|
|
2021-03-11 14:39:41 +00:00
|
|
|
export const relatedTests = new lc.RequestType<lc.TextDocumentPositionParams, TestInfo[], void>("rust-analyzer/relatedTests");
|
2021-02-27 17:04:43 +00:00
|
|
|
|
2020-05-25 12:56:26 +00:00
|
|
|
export interface SsrParams {
|
|
|
|
query: string;
|
|
|
|
parseOnly: boolean;
|
2020-07-22 05:00:28 +00:00
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
position: lc.Position;
|
2021-12-20 17:36:07 +00:00
|
|
|
selections: readonly lc.Range[];
|
2020-05-25 12:56:26 +00:00
|
|
|
}
|
|
|
|
export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr');
|
2020-06-03 11:15:54 +00:00
|
|
|
|
|
|
|
export interface CommandLink extends lc.Command {
|
|
|
|
/**
|
|
|
|
* A tooltip for the command, when represented in the UI.
|
|
|
|
*/
|
|
|
|
tooltip?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CommandLinkGroup {
|
|
|
|
title?: string;
|
|
|
|
commands: CommandLink[];
|
|
|
|
}
|
2020-08-30 08:02:29 +00:00
|
|
|
|
2020-09-01 08:26:10 +00:00
|
|
|
export const openDocs = new lc.RequestType<lc.TextDocumentPositionParams, string | void, void>('experimental/externalDocs');
|
2020-11-13 01:48:07 +00:00
|
|
|
|
|
|
|
export const openCargoToml = new lc.RequestType<OpenCargoTomlParams, lc.Location, void>("experimental/openCargoToml");
|
|
|
|
|
|
|
|
export interface OpenCargoTomlParams {
|
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
}
|
2021-03-16 12:37:00 +00:00
|
|
|
|
2021-04-13 18:32:45 +00:00
|
|
|
export const moveItem = new lc.RequestType<MoveItemParams, lc.TextEdit[], void>("experimental/moveItem");
|
2021-03-16 12:37:00 +00:00
|
|
|
|
|
|
|
export interface MoveItemParams {
|
2021-03-16 15:11:50 +00:00
|
|
|
textDocument: lc.TextDocumentIdentifier;
|
|
|
|
range: lc.Range;
|
|
|
|
direction: Direction;
|
2021-03-16 12:37:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const enum Direction {
|
|
|
|
Up = "Up",
|
|
|
|
Down = "Down"
|
|
|
|
}
|