Skip to content

Commit 0bbe00c

Browse files
committed
fix: avoid using sequential id for curator
1 parent cac7fd4 commit 0bbe00c

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

builtin/curator/git_grep.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export function gitGrep(): Curator<Detail> {
5555
.pipeThrough(new TextDecoderStream())
5656
.pipeThrough(new TextLineStream());
5757

58-
let id = 0;
5958
for await (const record of stream) {
6059
// Abort if the signal is triggered
6160
signal?.throwIfAborted();
@@ -70,7 +69,7 @@ export function gitGrep(): Curator<Detail> {
7069

7170
// Yield a structured item for each matched line
7271
yield {
73-
id: id++,
72+
id: `${abspath}:${line}:${column}`,
7473
value: `${abspath}:${line}:${column}:${context}`,
7574
detail: {
7675
path: abspath,

builtin/curator/grep.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export function grep(): Curator<Detail> {
5757
.pipeThrough(new TextDecoderStream())
5858
.pipeThrough(new TextLineStream());
5959

60-
let id = 0;
6160
for await (const record of stream) {
6261
// Abort if the signal is triggered
6362
signal?.throwIfAborted();
@@ -71,7 +70,7 @@ export function grep(): Curator<Detail> {
7170

7271
// Yield a structured item for each matched line
7372
yield {
74-
id: id++,
73+
id: `${path}:${line}`,
7574
value: `${path}:${line}:${context}`,
7675
detail: {
7776
path,

builtin/curator/rg.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export function rg(): Curator<Detail> {
5757
.pipeThrough(new TextDecoderStream())
5858
.pipeThrough(new TextLineStream());
5959

60-
let id = 0;
6160
for await (const record of stream) {
6261
// Abort if the signal is triggered
6362
signal?.throwIfAborted();
@@ -71,7 +70,7 @@ export function rg(): Curator<Detail> {
7170

7271
// Yield a structured item for each matched line
7372
yield {
74-
id: id++,
73+
id: `${path}:${line}:${column}`,
7574
value: `${path}:${line}:${column}:${context}`,
7675
detail: {
7776
path,

0 commit comments

Comments
 (0)