Skip to content

Commit ce92777

Browse files
levochkaaclaude
andcommitted
fix(server): JetBrains IDEs open file links at the right column
JetBrains IDEs read `--column` as zero-based, so `file.ts:12:4` put the caret one column to the right. Pass the column minus one. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 1688f96 commit ce92777

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/server/src/process/externalLauncher.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ for (const {} of [
340340
platform: "darwin",
341341
installPath: "Applications/WebStorm.app/Contents/MacOS/webstorm",
342342
editor: "webstorm",
343-
args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
343+
args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
344344
},
345345
{
346346
platform: "darwin",
@@ -364,13 +364,13 @@ for (const {} of [
364364
platform: "win32",
365365
installPath: "Programs/JetBrains/WebStorm 2026.2/bin/webstorm64.exe",
366366
editor: "webstorm",
367-
args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
367+
args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
368368
},
369369
{
370370
platform: "win32",
371371
installPath: "Programs/WebStorm/bin/webstorm64.exe",
372372
editor: "webstorm",
373-
args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
373+
args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
374374
},
375375
{
376376
platform: "win32",
@@ -382,7 +382,7 @@ for (const {} of [
382382
platform: "linux",
383383
installPath: ".local/share/JetBrains/Toolbox/scripts/idea",
384384
editor: "idea",
385-
args: ["--line", "12", "--column", "4", "/workspace with spaces/file.ts"],
385+
args: ["--line", "12", "--column", "3", "/workspace with spaces/file.ts"],
386386
},
387387
{
388388
platform: "linux",
@@ -472,7 +472,7 @@ it.effect.each([
472472
"--line",
473473
"12",
474474
"--column",
475-
"4",
475+
"3",
476476
"/workspace with spaces/file.ts",
477477
]);
478478
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),

‎apps/server/src/process/externalLauncher.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ function resolveCommandEditorArgs(
163163
onSome: ({ path, line, column }) => [
164164
"--line",
165165
line,
166+
// JetBrains IDEs count `--column` from 0; targets count columns from 1.
166167
...Option.match(column, {
167168
onNone: () => [],
168-
onSome: (value) => ["--column", value],
169+
onSome: (value) => ["--column", String(Math.max(0, Number(value) - 1))],
169170
}),
170171
path,
171172
],

0 commit comments

Comments
 (0)