Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 2b1fb43

Browse files
authored
feat(code search): Use filenames and line numbers (#28)
* Parse filename and linenumber correctly for both JSON and REGEX parsers * Revert changes made to LogTreeItem * Handle bad regex patterns * Update JSON parse to parse entire file over line by line parsing * Improve search term cleaning * Handle corner case when there is no path to the file name * Bump up version
1 parent 03693f9 commit 2b1fb43

File tree

6 files changed

+445
-389
lines changed

6 files changed

+445
-389
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "traceback",
33
"displayName": "TraceBack",
44
"description": "A VS Code extension that brings telemetry data (traces, logs, and metrics) into your code.",
5-
"version": "0.4.13",
5+
"version": "0.4.14",
66
"publisher": "hyperdrive-eng",
77
"repository": {
88
"type": "git",

src/claudeService.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,14 @@ Use the analyze_callers function to return the results in the exact format requi
433433
type: "string",
434434
description: "Capture group name for service name"
435435
},
436+
fileName: {
437+
type: "string",
438+
description: "Capture group name for source file name"
439+
},
440+
lineNumber: {
441+
type: "string",
442+
description: "Capture group name for source line number"
443+
}
436444
},
437445
additionalProperties: true
438446
}
@@ -452,6 +460,15 @@ Use the analyze_callers function to return the results in the exact format requi
452460
3. Variables - values shown in the log (e.g., "user_id=123") - if present
453461
4. Timestamp - in any format - if present
454462
5. Service name or component - if present
463+
6. File name - source file where the log originated - if present
464+
7. Line number - source line number in the file - if present
465+
466+
Pay special attention to file names and line numbers which might appear in formats like:
467+
- at fileName:lineNumber
468+
- in fileName line lineNumber
469+
- fileName(lineNumber)
470+
- [fileName:lineNumber]
471+
- fileName.ext:lineNumber
455472
456473
Log samples:
457474
${selectedSamples.map((sample, i) => `${i+1}. ${sample}`).join('\n')}`;
@@ -482,8 +499,16 @@ The pattern should be comprehensive enough to extract:
482499
- timestamp: The timestamp in any format, if present
483500
- message: The main log message content
484501
- serviceName: The name of the service or component generating the log
502+
- fileName: The source file name if present (with or without extension)
503+
- lineNumber: The line number in the source file if present
485504
- Any other relevant fields
486505
506+
For file names and line numbers, ensure the patterns can handle:
507+
- Various delimiters between file name and line number (:, line, at line, etc.)
508+
- File names with or without extensions
509+
- File paths (partial or full)
510+
- Line numbers in different formats (parentheses, brackets, after "line", etc.)
511+
487512
Ensure the regex patterns:
488513
- Are compatible with JavaScript's regular expression engine
489514
- Use named capture groups for all extracted fields

0 commit comments

Comments
 (0)