From d605ec9c321392d9c7ee4b440c560e1e405d92e6 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sun, 31 May 2020 05:13:08 +0300 Subject: Change Runnable.bin -> Runnable.kind As per matklad, we now pass the responsibility for finding the binary to the frontend. Also, added caching for finding the binary path to reduce the amount of filesystem interactions. --- editors/code/src/lsp_ext.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 4da12eb30..3e0b60699 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -45,10 +45,13 @@ export interface RunnablesParams { textDocument: lc.TextDocumentIdentifier; position: lc.Position | null; } + +export type RunnableKind = "cargo" | "rustc" | "rustup"; + export interface Runnable { range: lc.Range; label: string; - bin: string; + kind: RunnableKind; args: string[]; extraArgs: string[]; env: { [key: string]: string }; -- cgit v1.2.3 From 03039821195c9d9c4bbc1e4cbddb6378c43a6c52 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Jun 2020 17:22:23 +0200 Subject: New runnables API --- editors/code/src/lsp_ext.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 3e0b60699..73d573678 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -46,16 +46,15 @@ export interface RunnablesParams { position: lc.Position | null; } -export type RunnableKind = "cargo" | "rustc" | "rustup"; - export interface Runnable { - range: lc.Range; label: string; - kind: RunnableKind; - args: string[]; - extraArgs: string[]; - env: { [key: string]: string }; - cwd: string | null; + location?: lc.LocationLink; + kind: "cargo"; + args: { + workspaceRoot?: string; + cargoArgs: string[]; + executableArgs: string[]; + }; } export const runnables = new lc.RequestType("rust-analyzer/runnables"); -- cgit v1.2.3 From a83ab820a4633bac718ee0fd11f06d1b3142be6b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Jun 2020 17:34:18 +0200 Subject: Spec better runnables --- editors/code/src/lsp_ext.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 73d573678..c51acfccb 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -56,7 +56,7 @@ export interface Runnable { executableArgs: string[]; }; } -export const runnables = new lc.RequestType("rust-analyzer/runnables"); +export const runnables = new lc.RequestType("experimental/runnables"); export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint | InlayHint.ChainingHint; -- cgit v1.2.3 From 57cd936c5262c3b43626618be42d7a72f71c3539 Mon Sep 17 00:00:00 2001 From: Mikhail Rakhmanov Date: Tue, 2 Jun 2020 22:21:48 +0200 Subject: Preliminary implementation of lazy CodeAssits --- editors/code/src/lsp_ext.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 3e0b60699..f881bae47 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -33,6 +33,13 @@ export const matchingBrace = new lc.RequestType("experimental/parentModule"); +export interface ResolveCodeActionParams { + id: string; + label: string; + codeActionParams: lc.CodeActionParams; +} +export const resolveCodeAction = new lc.RequestType('experimental/resolveCodeAction'); + export interface JoinLinesParams { textDocument: lc.TextDocumentIdentifier; ranges: lc.Range[]; -- cgit v1.2.3 From bacd0428fa0fd744eb0aac6d5d7abd18c6c707b7 Mon Sep 17 00:00:00 2001 From: Mikhail Rakhmanov Date: Wed, 3 Jun 2020 18:39:01 +0200 Subject: Fix review comments --- editors/code/src/lsp_ext.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 35d73ce31..9793b926c 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -35,7 +35,6 @@ export const parentModule = new lc.RequestType('experimental/resolveCodeAction'); -- cgit v1.2.3 From 7d0dd17b09240385333805637ea17992a8089cf2 Mon Sep 17 00:00:00 2001 From: vsrs Date: Wed, 3 Jun 2020 14:15:54 +0300 Subject: Add hover actions as LSP extension --- editors/code/src/lsp_ext.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'editors/code/src/lsp_ext.ts') diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 9793b926c..e16ea799c 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -90,3 +90,15 @@ export interface SsrParams { parseOnly: boolean; } export const ssr = new lc.RequestType('experimental/ssr'); + +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[]; +} -- cgit v1.2.3