Skip to content
TypeScript

fix(server): JetBrains IDEs open file links at the right column (#22826)

Lev Poznyakov1befc717f0b2
diff --git a/apps/server/src/process/externalLauncher.test.ts b/apps/server/src/process/externalLauncher.test.ts
index 787a729f86b..73ff1b067e8 100644
--- a/apps/server/src/process/externalLauncher.test.ts
+++ b/apps/server/src/process/externalLauncher.test.ts
@@ -340,7 +340,7 @@ for (const {} of [
platform: "darwin",
installPath: "Applications/WebStorm.app/Contents/MacOS/webstorm",
editor: "webstorm",
- args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
+ args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
},
{
platform: "darwin",
@@ -364,13 +364,13 @@ for (const {} of [
platform: "win32",
installPath: "Programs/JetBrains/WebStorm 2026.2/bin/webstorm64.exe",
editor: "webstorm",
- args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
+ args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
},
{
platform: "win32",
installPath: "Programs/WebStorm/bin/webstorm64.exe",
editor: "webstorm",
- args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
+ args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
},
{
platform: "win32",
@@ -382,7 +382,7 @@ for (const {} of [
platform: "linux",
installPath: ".local/share/JetBrains/Toolbox/scripts/idea",
editor: "idea",
- args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
+ args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
},
{
platform: "linux",
@@ -472,7 +472,7 @@ it.effect.each([
"--line",
"12",
"--column",
- "4",
+ "3",
"/workspace with spaces/file.ts",
]);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
diff --git a/apps/server/src/process/externalLauncher.ts b/apps/server/src/process/externalLauncher.ts
index 2c24857555b..1260f2e3fda 100644
--- a/apps/server/src/process/externalLauncher.ts
+++ b/apps/server/src/process/externalLauncher.ts
@@ -163,9 +163,10 @@ function resolveCommandEditorArgs(
onSome: ({ path, line, column }) => [
"--line",
line,
+ // JetBrains IDEs count `--column` from 0; targets count columns from 1.
...Option.match(column, {
onNone: () => [],
- onSome: (value) => ["--column", value],
+ onSome: (value) => ["--column", String(Math.max(0, Number(value) - 1))],
}),
path,
],