mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
feature: add build system info; runnables to rust-project.json
This commit is contained in:
parent
14a1f4530c
commit
71a78a9cdc
17 changed files with 628 additions and 227 deletions
|
@ -2,6 +2,7 @@ import * as vscode from "vscode";
|
|||
import { strict as nativeAssert } from "assert";
|
||||
import { exec, type ExecOptions, spawnSync } from "child_process";
|
||||
import { inspect } from "util";
|
||||
import type { CargoRunnableArgs, ShellRunnableArgs } from "./lsp_ext";
|
||||
import type { Env } from "./client";
|
||||
|
||||
export function assert(condition: boolean, explanation: string): asserts condition {
|
||||
|
@ -77,6 +78,12 @@ export function isCargoTomlDocument(document: vscode.TextDocument): document is
|
|||
return document.uri.scheme === "file" && document.fileName.endsWith("Cargo.toml");
|
||||
}
|
||||
|
||||
export function isCargoRunnableArgs(
|
||||
args: CargoRunnableArgs | ShellRunnableArgs,
|
||||
): args is CargoRunnableArgs {
|
||||
return (args as CargoRunnableArgs).executableArgs !== undefined;
|
||||
}
|
||||
|
||||
export function isRustEditor(editor: vscode.TextEditor): editor is RustEditor {
|
||||
return isRustDocument(editor.document);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue