You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 42fa839
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ide): stop passing --keep-going to rust-analyzer twice
rust-analyzer already passes --keep-going to cargo check, and cargo rejects the duplicate, so VS Code showed no Rust diagnostics. Drop rust-analyzer.check.extraArgs from the generated settings; cstudy ide rewrites an unedited settings.json.
Copy file name to clipboardExpand all lines: docs/guides/toolchains.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ Nothing else is needed: the runner crates' only dependencies, `rust_decimal` and
188
188
189
189
-**Your Cargo setup**: `cstudy` ignores your Cargo configuration for its builds. `RUSTFLAGS`, rustc wrappers such as `sccache`, `CARGO_TARGET_DIR`, `CARGO_BUILD_*` and `CARGO_PROFILE_*` do not reach them, and crates.io always resolves to the vendored crates, so none can break a build or change what it measures. They still apply to the `cargo` commands you run yourself. Builds go to `.cs/build/rust` in the workspace.
190
190
-**Copied files**: Cargo rebuilds a crate only when a source is newer than the last build, so a file replaced by a copy that keeps an older time (`rsync -a`, `cp -p`) would run the old code. `cstudy` records a digest of your practice file, or of the Rust files and `Cargo.toml` of a project folder, at each build, and touches the ones that changed before Cargo runs, so the new code always builds. Nothing else is needed; your own `cargo` commands in `rust/` do not get this and still go by times.
191
-
-**Editor**: `rust/Cargo.toml` lists each problem you start, so rust-analyzer checks every file; open the workspace root, or `rust/`. Its `rust/.cargo/config.toml` resolves `rust_decimal` and `chrono` from the vendored crates, for `cargo` commands run in `rust/`. The workspace's VS Code files recommend rust-analyzer (`rust-lang.rust-analyzer`), link `rust/Cargo.toml` and check with `--keep-going`; `cstudy ide` adds them to a workspace created earlier. The extension's rust-analyzer needs a recent stable toolchain: with an older one it reports an outdated toolchain and may flag standard macros such as `todo!` and `vec!`, which `rustup update` fixes.
191
+
-**Editor**: `rust/Cargo.toml` lists each problem you start, so rust-analyzer checks every file; open the workspace root, or `rust/`. Its `rust/.cargo/config.toml` resolves `rust_decimal` and `chrono` from the vendored crates, for `cargo` commands run in `rust/`. The workspace's VS Code files recommend rust-analyzer (`rust-lang.rust-analyzer`), link `rust/Cargo.toml` and check every target; `cstudy ide` adds them to a workspace created earlier. If an older `cstudy` wrote `"rust-analyzer.check.extraArgs": ["--keep-going"]` into your `.vscode/settings.json` and you edited that file, remove the key (rust-analyzer already passes `--keep-going`, and cargo rejects it twice), or run `cstudy ide --force`. The extension's rust-analyzer needs a recent stable toolchain: with an older one it reports an outdated toolchain and may flag standard macros such as `todo!` and `vec!`, which `rustup update` fixes.
192
192
- **Debugging**: `cstudy test --debug` runs the Rust runner under LLDB's debug server, and in VS Code **Debug current file (Rust)** attaches CodeLLDB (`vadimcn.vscode-lldb`, which the workspace's VS Code files recommend). On macOS the server is `debugserver`, which the Xcode Command Line Tools (`xcode-select --install`) and Xcode ship inside LLDB.framework; `cstudy` finds it as `lldb` does, through `xcode-select -p`. macOS lets a program be debugged only with permission: members of the `_developer` group have it (`id -Gn` lists your groups); for anyone else macOS asks for an administrator when a debug session starts, until an administrator turns developer mode on with `sudo DevToolsSecurity -enable`. On Linux the server is `lldb-server`, from your distribution's `lldb` package (`sudo apt install lldb` on Debian and Ubuntu; a versioned package alone, such as `lldb-18`, installs only `lldb-server-18`), and `cstudy` looks for it on `PATH`. In a Docker container, start the container with `--security-opt seccomp=unconfined`: the default profile refuses the call `lldb-server` makes to turn off address randomization, and the debug run stops with `personality set failed: Operation not permitted`. A debugged test of a Rust project problem is reported as an `error` on Linux, because `lldb-server` sends the test's output only to your debugger: read the result there. `cstudy doctor` warns while the server is missing.
Copy file name to clipboardExpand all lines: docs/specs/installation-and-workspaces.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ One catalog (`coding_study/domain/ide_actions.py`) lists these actions, and both
204
204
|------|-------|
205
205
|`.vscode/tasks.json`| A `process` task per action and scope (`cstudy test (current file)` runs `cstudy test ${file}` in `${workspaceFolder}`); `done` asks for the outcome through a `pickString` input. The `cstudy test --debug` tasks are background tasks whose problem matcher ends at `cstudy: waiting for debugger on 127.0.0.1:<port>`|
206
206
| `.vscode/launch.json` | `Debug current file (<language>)` and `Debug active attempt (<language>)` for Python (`debugpy` attach, port 5678), TypeScript (`node` attach, 9229), Java (`java` attach, 5005), Go (the Go extension's `go` attach in `"mode": "remote"` to the headless Delve, 2345) and Rust (CodeLLDB's `lldb` attach: `targetCreateCommands` `["target create \"\""]`, an empty target that takes the executable the debug server reports, since each run launches its own copy of the runner, then `processCreateCommands` `["gdb-remote 127.0.0.1:12345"]`; `preTerminateCommands` an lldb `script` one-liner that kills the process only while it is alive (`lldb.process.is_alive`; a plain `process kill` would print `error: Process must be launched.` after a run that already finished), because CodeLLDB detaches from an attached process when its session ends and the runner would go on without a debugger; and `sourceLanguages` `["rust"]` for Rust's formatters), each starting its `cstudy test --debug` task first; all on 127.0.0.1. None for Kotlin: VS Code's Java debugger never binds Kotlin breakpoints ([vscode-java-debug#241](https://github.com/microsoft/vscode-java-debug/issues/241)) |
207
-
|`.vscode/settings.json`|`python.defaultInterpreterPath``${workspaceFolder}/python/.venv/bin/python`, `typescript.tsdk``typescript/node_modules/typescript/lib`, `java.import.gradle.enabled`, `go.toolsEnvVars``{"GOTOOLCHAIN": "local"}`, `rust-analyzer.linkedProjects``["rust/Cargo.toml"]`, then `projects/<slug>/Cargo.toml` of each [Rust project folder](#project-folders) in path order, with `rust-analyzer.check.allTargets` and `rust-analyzer.check.extraArgs``["--keep-going"]`, watcher and search exclusions for build output (`target` included) and for `projects/*/.venv`, the links to the shared venv; no JDK path |
207
+
|`.vscode/settings.json`|`python.defaultInterpreterPath``${workspaceFolder}/python/.venv/bin/python`, `typescript.tsdk``typescript/node_modules/typescript/lib`, `java.import.gradle.enabled`, `go.toolsEnvVars``{"GOTOOLCHAIN": "local"}`, `rust-analyzer.linkedProjects``["rust/Cargo.toml"]`, then `projects/<slug>/Cargo.toml` of each [Rust project folder](#project-folders) in path order, with `rust-analyzer.check.allTargets`, watcher and search exclusions for build output (`target` included) and for `projects/*/.venv`, the links to the shared venv; no JDK path |
|`.idea/misc.xml`| The project JDK named after the feature release of [the selected JDK](cli.md#the-selected-jdk) (`26`; `JavaSDK`) and the language level of the build's [release level](runners.md#the-jdk-and-the-release-level) (`JDK_26`, which JDK 27 gets too), so IntelliJ's Gradle import, which runs with the project JDK, compiles as `cstudy test` does. With no JDK selected it names the recommended `25`. [`cstudy ide`](cli.md#cstudy-ide) replaces it while it is still as written, so a JDK switch updates it, and keeps it, with a warning, once IntelliJ or you changed it |
210
210
|`.idea/gradle.xml`|`jvm/` linked as a Gradle project with its `java` and `kotlin` modules, run with the project JDK (`#USE_PROJECT_JDK`) |
@@ -217,7 +217,7 @@ Go and Rust need no tasks or run configurations of their own: every action is la
217
217
|`go.toolsEnvVars``GOTOOLCHAIN=local`| The Go extension's tools (gopls) run as `cstudy` does and never download the toolchain `go/go.mod` asks for ([toolchains](../guides/toolchains.md#go)). gopls finds `go/` through the `go.work` at the workspace root; no setting is needed for that |
218
218
|`rust-analyzer.linkedProjects``rust/Cargo.toml`| The Cargo project is in `rust/`, not at the workspace root |
219
219
|`rust-analyzer.linkedProjects``projects/<slug>/Cargo.toml`| Each Rust project folder is a crate of its own, outside `rust/`; a folder is a Rust project when it holds a `Cargo.toml`. `cstudy start` refreshes VS Code's files when it writes a new Rust folder, once `cstudy` has written them; a folder started otherwise, or while a `settings.json` you edited is kept, is missing until `cstudy ide` runs again, and `cstudy doctor` says so |
220
-
|`rust-analyzer.check.allTargets`, `rust-analyzer.check.extraArgs``--keep-going`| Each problem is an `[[example]]` built as a library crate ([ADR 0012](../decisions/0012-go-and-rust.md)); checking every target covers them, and `--keep-going`reports the errors of every problem when one is broken instead of stopping at the first|
220
+
|`rust-analyzer.check.allTargets`| Each problem is an `[[example]]` built as a library crate ([ADR 0012](../decisions/0012-go-and-rust.md)); checking every target covers them. rust-analyzer passes `--keep-going`to `cargo check` itself, so the errors of every problem show when one is broken; the setting `rust-analyzer.check.extraArgs``["--keep-going"]`, which earlier `cstudy` versions wrote, makes cargo reject the duplicate and VS Code show no Rust diagnostics, so `cstudy ide` drops it while `settings.json` is as `cstudy` wrote it, and an edited one needs the key removed by hand or `cstudy ide --force`|
221
221
222
222
An existing workspace gets the new settings and extensions from `cstudy ide`, which follows the rewriting rule below: it updates `settings.json` and `extensions.json` while they are as `cstudy` wrote them, and keeps (with a warning) the ones you edited until `cstudy ide --force`, or until you copy the keys over. `cstudy doctor --fix` never writes IDE files. Debug configurations for Go and Rust are not generated yet.
0 commit comments