Skip to content

Commit 3dffede

Browse files
Eric LeeseDevtools-frontend LUCI CQ
authored andcommitted
Change error path rewriting to work in full chromium checkout
Instead of calculating the path relative to the root of the DevTools source tree, we now just remove "../../" to get the relative path. This makes terminal links in vscode work in full Chromium checkouts as well as devtools only checkouts. Bug: None Change-Id: I7bf410c353c5929bc9a0ef064449fa88f3bc1264 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6405079 Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]> Reviewed-by: Nikolay Vitkov <[email protected]>
1 parent 4ec6841 commit 3dffede

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scripts/build/typescript/ts_library.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,14 @@ def runEsbuild(opts, tsconfig_output_location, tsconfig_output_directory):
170170

171171

172172
def rewriteTypeScriptErrorPaths(stderr: str):
173-
root_path = Path(ROOT_DIRECTORY_OF_REPOSITORY).resolve()
174-
175173
def rewriteLine(match: re.Match[str]) -> str:
176-
absolute_path = Path(match[1]).resolve()
177-
relative_path = absolute_path.relative_to(root_path)
178-
return f"{relative_path}({match[2]}): error {match[3]}: {match[4]}"
174+
return f"{match[1]}({match[2]}): error {match[3]}: {match[4]}"
179175

180176
lines = stderr.splitlines()
181177
for i, line in enumerate(lines):
182178
lines[i] = re.sub(
183179
# We use similar pattern in ".vscode/devtools-workspace-tasks.json"
184-
r'^([^\s].*)\((\d+,\d+)\): error (TS\d+):\s*(.*)$',
180+
r'^\.\./\.\./([^\s].*)\((\d+,\d+)\): error (TS\d+):\s*(.*)$',
185181
rewriteLine,
186182
line)
187183

0 commit comments

Comments
 (0)