From 105b5c13da74ab2aa70811c29eea50e35a46e754 Mon Sep 17 00:00:00 2001 From: Yu Chen Date: Thu, 14 Jul 2022 10:10:36 +0800 Subject: [PATCH] support rust-analyzer for board_qemu features --- .gitignore | 3 +++ .vscode/settings.json | 13 +++++++++++++ user/Cargo.toml | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 32f926a7..43918622 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/user/Cargo.toml b/user/Cargo.toml index d843673c..8edd701a 100644 --- a/user/Cargo.toml +++ b/user/Cargo.toml @@ -10,3 +10,7 @@ edition = "2018" [profile.release] debug = true + +[features] +board_qemu = [] +board_k210 = [] \ No newline at end of file