Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

test(go): run the suites without a Go toolchain and on Windows (#550)

l0ng-ai8f85f35ebe96
diff --git a/crates/ide-dap/src/adapter.rs b/crates/ide-dap/src/adapter.rs
index f1f16bf44..341e0663b 100644
--- a/crates/ide-dap/src/adapter.rs
+++ b/crates/ide-dap/src/adapter.rs
@@ -574,8 +574,6 @@ async fn connect_with_retries(
mod tests {
use super::*;
- /// Managed tools win over `PATH`, and debugpy falls back to the private copy.
- #[cfg(unix)]
#[tokio::test]
async fn program_output_is_forwarded_without_the_adapter_banner() {
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel();
@@ -588,6 +586,8 @@ mod tests {
assert_eq!(sink.lock().len(), 3);
}
+ /// Managed tools win over `PATH`, and debugpy falls back to the private copy.
+ #[cfg(unix)]
#[tokio::test]
async fn managed_tools_and_private_debugpy() {
use std::os::unix::fs::PermissionsExt;
diff --git a/crates/ide-run/tests/process.rs b/crates/ide-run/tests/process.rs
index 791ffcef2..e94b0e666 100644
--- a/crates/ide-run/tests/process.rs
+++ b/crates/ide-run/tests/process.rs
@@ -510,8 +510,10 @@ fn cmake_configure_discovers_builds_and_runs_a_multifile_target() {
#[test]
fn go_build_runs_with_separate_arguments_environment_and_working_directory() {
let h = harness();
- let go =
- ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()).expect("Go toolchain");
+ let Some(go) = ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()) else {
+ eprintln!("skipped: no Go toolchain");
+ return;
+ };
let module = h.root.path().join("module");
std::fs::create_dir_all(&module).unwrap();
std::fs::write(module.join("go.mod"), "module example.com/demo\ngo 1.22\n").unwrap();
@@ -550,8 +552,10 @@ fn go_build_runs_with_separate_arguments_environment_and_working_directory() {
#[test]
fn go_file_tests_use_build_selected_sources_and_only_the_selected_test_file() {
let h = harness();
- let go =
- ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()).expect("Go toolchain");
+ let Some(go) = ide_run::which::find_executable("go", &std::env::var_os("PATH").unwrap_or_default()) else {
+ eprintln!("skipped: no Go toolchain");
+ return;
+ };
std::fs::write(h.root.path().join("go.mod"), "module example.com/filetests\ngo 1.22\n").unwrap();
std::fs::write(h.root.path().join("main.go"), "package filetests\nfunc value() int { return 2 }\n").unwrap();
std::fs::write(h.root.path().join("generate.go"), "//go:build ignore\n\npackage main\nfunc main() {}\n").unwrap();
diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json
index a2c997cad..a48b7fbf9 100644
--- a/src/platform/locales/text/zh.json
+++ b/src/platform/locales/text/zh.json
@@ -5269,7 +5269,6 @@
"Create Patch from Shelved Changes…": "从搁置更改创建补丁…",
"Build Tags": "构建标签",
"Go Version": "Go 版本",
- "CGO": "CGO",
"Custom Tags": "自定义标签",
"Experiments": "实验功能",
"Open a project to configure Go build tags.": "打开项目以配置 Go 构建标签。",
@@ -5303,23 +5302,11 @@
"Module directory": "模块目录",
"Path relative to go.work, or an absolute directory containing go.mod": "相对于 go.work 的路径,或包含 go.mod 的目录的绝对路径",
"Reload External Libraries": "重新加载外部库",
- "GOPROXY": "GOPROXY",
- "GOPRIVATE": "GOPRIVATE",
- "GOFLAGS": "GOFLAGS",
- "GONOPROXY": "GONOPROXY",
- "GONOSUMDB": "GONOSUMDB",
- "GOSUMDB": "GOSUMDB",
- "GOMODCACHE": "GOMODCACHE",
- "GOTOOLCHAIN": "GOTOOLCHAIN",
- "GOWORK": "GOWORK",
"Run Go Generate": "运行 Go Generate",
"Go Generate File": "为文件运行 Go Generate",
"Go Generate Package": "为包运行 Go Generate",
"Architecture": "架构",
"Compiler": "编译器",
- "go1.22": "go1.22",
- "integration debug": "integration debug",
- "loopvar,rangefunc": "loopvar,rangefunc",
"No CMake executable target for this file": "此文件没有对应的 CMake 可执行目标",
"Run CMake Configure from the Run selector, then choose the executable target. Files in a CMake project are built with their target.": "请从运行选择器执行 CMake Configure,然后选择可执行目标。CMake 项目中的文件由所属目标构建,不会单独编译。"
}
diff --git a/src/platform/locales/textCatalog.test.ts b/src/platform/locales/textCatalog.test.ts
index 82c2e2512..b0963067f 100644
--- a/src/platform/locales/textCatalog.test.ts
+++ b/src/platform/locales/textCatalog.test.ts
@@ -79,6 +79,20 @@ const BUILT_AT_RUNTIME = new Set<string>([]);
/** Text that stays as written in every locale: names, code, formats, shortcuts. */
const UNTRANSLATED = new Set<string>([
+ // Go environment variables and placeholder values
+ "CGO",
+ "GOPROXY",
+ "GOPRIVATE",
+ "GOFLAGS",
+ "GONOPROXY",
+ "GONOSUMDB",
+ "GOSUMDB",
+ "GOMODCACHE",
+ "GOTOOLCHAIN",
+ "GOWORK",
+ "go1.22",
+ "integration debug",
+ "loopvar,rangefunc",
// SSH and run-target placeholders
"SSH",
"example.com",