@samitouri / QOS-React / commits / 190758e623

[DevTools] Add column to vscode editor preset (#33994)

We should jump to the right column. Unfortunately, the way presets are set up now you have to switch off and switch to the preset for this to take effect.

Sebastian Markbåge committed Jul 25, 2025 at 10:21 UTC 190758e6236938283b51dce7d3fd21af6801a470
2 files changed +6 -3
packages/react-devtools-shared/src/devtools/views/Editor/utils.js
+5 -2
@@ -16,7 +16,7 @@ export function checkConditions(
16 try {
17 const url = new URL(editorURL);
18
19 - const [, sourceURL, line] = source;
19 + const [, sourceURL, line, column] = source;
20 let filePath;
21
22 // Check if sourceURL is a correct URL, which has a protocol specified
@@ -47,12 +47,15 @@ export function checkConditions(
47 }
48
49 const lineNumberAsString = String(line);
50 + const columnNumberAsString = String(column);
51
52 url.href = url.href
53 .replace('{path}', filePath)
54 .replace('{line}', lineNumberAsString)
55 + .replace('{column}', columnNumberAsString)
56 .replace('%7Bpath%7D', filePath)
55 - .replace('%7Bline%7D', lineNumberAsString);
57 + .replace('%7Bline%7D', lineNumberAsString)
58 + .replace('%7Bcolumn%7D', columnNumberAsString);
59
60 return {url, shouldDisableButton: false};
61 } catch (e) {
packages/react-devtools-shared/src/devtools/views/Settings/CodeEditorOptions.js
+1 -1
@@ -17,7 +17,7 @@ import {getDefaultOpenInEditorURL} from 'react-devtools-shared/src/utils';
17
18 import styles from './SettingsShared.css';
19
20 -const vscodeFilepath = 'vscode://file/{path}:{line}';
20 +const vscodeFilepath = 'vscode://file/{path}:{line}:{column}';
21
22 export default function CodeEditorOptions({
23 environmentNames,