3561: feat: add debug code lens r=matklad a=hdevalke Refs #3539 3577: Protect against infinite macro expansion in def collector r=edwin0cheng a=flodiebold Something I noticed while trying to make macro expansion more resilient against errors. There was a test for this, but it wasn't actually working because the first recursive expansion failed. (The comma...) Even with this limit, that test (when fixed) still takes some time to pass because of the exponential growth of the expansions, so I disabled it and added a different one without growth. CC @edwin0cheng Co-authored-by: Hannes De Valkeneer <hannes@de-valkeneer.be> Co-authored-by: hdevalke <2261239+hdevalke@users.noreply.github.com> Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
This commit is contained in:
@@ -46,6 +46,7 @@ export async function createClient(config: Config, serverPath: string): Promise<
|
||||
withSysroot: config.withSysroot,
|
||||
cargoFeatures: config.cargoFeatures,
|
||||
rustfmtArgs: config.rustfmtArgs,
|
||||
vscodeLldb: vscode.extensions.getExtension("vadimcn.vscode-lldb") != null,
|
||||
},
|
||||
traceOutputChannel,
|
||||
middleware: {
|
||||
|
||||
@@ -62,6 +62,26 @@ export function runSingle(ctx: Ctx): Cmd {
|
||||
};
|
||||
}
|
||||
|
||||
export function debugSingle(ctx: Ctx): Cmd {
|
||||
return async (config: ra.Runnable) => {
|
||||
const editor = ctx.activeRustEditor;
|
||||
if (!editor) return;
|
||||
|
||||
const debugConfig = {
|
||||
type: "lldb",
|
||||
request: "launch",
|
||||
name: config.label,
|
||||
cargo: {
|
||||
args: config.args,
|
||||
},
|
||||
args: config.extraArgs,
|
||||
cwd: config.cwd
|
||||
};
|
||||
|
||||
return vscode.debug.startDebugging(undefined, debugConfig);
|
||||
};
|
||||
}
|
||||
|
||||
class RunnableQuickPick implements vscode.QuickPickItem {
|
||||
public label: string;
|
||||
public description?: string | undefined;
|
||||
@@ -87,7 +107,7 @@ function createTask(spec: ra.Runnable): vscode.Task {
|
||||
type: 'cargo',
|
||||
label: spec.label,
|
||||
command: spec.bin,
|
||||
args: spec.args,
|
||||
args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args,
|
||||
env: spec.env,
|
||||
};
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
// Internal commands which are invoked by the server.
|
||||
ctx.registerCommand('runSingle', commands.runSingle);
|
||||
ctx.registerCommand('debugSingle', commands.debugSingle);
|
||||
ctx.registerCommand('showReferences', commands.showReferences);
|
||||
ctx.registerCommand('applySourceChange', commands.applySourceChange);
|
||||
ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange);
|
||||
|
||||
@@ -80,13 +80,12 @@ export interface Runnable {
|
||||
label: string;
|
||||
bin: string;
|
||||
args: Vec<string>;
|
||||
extraArgs: Vec<string>;
|
||||
env: FxHashMap<string, string>;
|
||||
cwd: Option<string>;
|
||||
}
|
||||
export const runnables = request<RunnablesParams, Vec<Runnable>>("runnables");
|
||||
|
||||
|
||||
|
||||
export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint;
|
||||
|
||||
export namespace InlayHint {
|
||||
|
||||
Reference in New Issue
Block a user