From a03f73d2dd36d5c947a128d719eb6baddb74e52c Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Thu, 14 Jul 2022 09:59:06 +0800 Subject: [PATCH] support rust-analyzer for board_qemu features --- .gitignore | 3 +++ .vscode/settings.json | 13 +++++++++++++ easy-fs-fuse/Cargo.toml | 6 +++++- easy-fs/Cargo.toml | 4 ++++ user/Cargo.toml | 4 ++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 87872242..78059028 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +.*/* +!.github/* +!.vscode/settings.json .idea Cargo.lock target diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..bf81ab53 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + // Prevent "can't find crate for `test`" error on no_std + // Ref: https://github.com/rust-lang/vscode-rust/issues/729 + // For vscode-rust plugin users: + "rust.target": "riscv64gc-unknown-none-elf", + "rust.all_targets": false, + // For Rust Analyzer plugin users: + "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf", + "rust-analyzer.checkOnSave.allTargets": false, + "rust-analyzer.cargo.features": [ + "board_qemu" + ] +} \ No newline at end of file diff --git a/easy-fs-fuse/Cargo.toml b/easy-fs-fuse/Cargo.toml index ee0ef971..0527e9b8 100644 --- a/easy-fs-fuse/Cargo.toml +++ b/easy-fs-fuse/Cargo.toml @@ -9,4 +9,8 @@ edition = "2018" [dependencies] clap = "2.33.3" easy-fs = { path = "../easy-fs" } -rand = "0.8.0" \ No newline at end of file +rand = "0.8.0" + +[features] +board_qemu = [] +board_k210 = [] \ No newline at end of file diff --git a/easy-fs/Cargo.toml b/easy-fs/Cargo.toml index c9690776..7a2f38ed 100644 --- a/easy-fs/Cargo.toml +++ b/easy-fs/Cargo.toml @@ -12,3 +12,7 @@ lazy_static = { version = "1.4.0", features = ["spin_no_std"] } [profile.release] debug = true + +[features] +board_qemu = [] +board_k210 = [] \ No newline at end of file diff --git a/user/Cargo.toml b/user/Cargo.toml index 5609044f..fe4fc563 100644 --- a/user/Cargo.toml +++ b/user/Cargo.toml @@ -12,3 +12,7 @@ bitflags = "1.2.1" [profile.release] debug = true + +[features] +board_qemu = [] +board_k210 = [] \ No newline at end of file