Skip to content

Commit c36aff6

Browse files
committed
Enable rust support for IDE
1 parent 4e258b4 commit c36aff6

File tree

6 files changed

+31
-6
lines changed

6 files changed

+31
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ _logs
88
# Ruff
99
.ruff_cache
1010
target/
11+
12+
rust-project.json

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rust-analyzer.linkedProjects": [
3+
"rust-project.json"
4+
]
5+
}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ local_path_override(module_name = "score_tooling", path = "../tooling")
120120
- Unify LLVM toolchain versions across modules.
121121
- Introduce integration tests for `@itf` once build succeeds.
122122

123+
## IDE support
124+
125+
### Rust
126+
127+
Use `./generate_rust_analyzer_support.sh` to generate rust_analyzer settings that will let VS Code work.
128+
123129
## 📌 Quick Reference
124130

125131
| Area | Status | Action |

feature_showcase/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ filegroup(
55
"//feature_showcase/rust:orch_per_example",
66
],
77
)
8+
9+
10+
11+
genrule(
12+
name = "build_all",
13+
srcs = [
14+
"//feature_showcase/rust:kyron_example",
15+
"//feature_showcase/rust:orch_per_example",
16+
],
17+
outs = ["done.txt"],
18+
cmd = "echo built > $@",
19+
)

feature_showcase/rust/BUILD

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ load("@rules_rust//rust:defs.bzl", "rust_binary")
1616
rust_binary(
1717
name = "kyron_example",
1818
srcs = glob(["kyron/**/*.rs"]),
19-
tags = [
20-
"manual",
21-
],
2219
deps = [
2320
"@score_orchestrator//src/kyron:libkyron",
2421
"@score_orchestrator//src/kyron-foundation:libkyron_foundation",
@@ -30,9 +27,6 @@ rust_binary(
3027
rust_binary(
3128
name = "orch_per_example",
3229
srcs = glob(["orchestration_persistency/**/*.rs"]),
33-
tags = [
34-
"manual",
35-
],
3630
deps = [
3731
"@score_orchestrator//src/kyron:libkyron",
3832
"@score_orchestrator//src/kyron-foundation:libkyron_foundation",

generate_rust_analyzer_support.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Manual targets are not take into account, must be set explicitly
6+
bazel run @rules_rust//tools/rust_analyzer:gen_rust_project -- "@//feature_showcase/..." "@//feature_integration_tests/rust_test_scenarios:rust_test_scenarios"

0 commit comments

Comments
 (0)