From 5885de44ae8f3ab45417906e993516002cbf42c2 Mon Sep 17 00:00:00 2001 From: Ian Kerins Date: Tue, 26 Dec 2023 01:16:42 -0500 Subject: [PATCH] Remove TODO about extra zoekt newlines Fixed upstream: https://github.com/sourcegraph/zoekt/commit/e92f6c764b567d9b359633fa4045cfba9d37eb3c --- src/lib/server/content-parser.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/server/content-parser.ts b/src/lib/server/content-parser.ts index 7c28cf9..759efa9 100644 --- a/src/lib/server/content-parser.ts +++ b/src/lib/server/content-parser.ts @@ -131,16 +131,6 @@ Array> => { // naturally has a trailing newline; if there's a newline at the last byte, // this indicates that there is a final line that is empty. lines.push(currentLineTokens); - // TODO this incorrectly produces an extra line if the newline is the last - // byte in the file. I don't think there's a way to properly distinguish such - // a situation using the provided zoekt API response unless we ask it for the - // contents of the entire file and compare `baseByteOffset + - // contentBytes.length` to the byte length of the file. - // - // I think this is a fundamentally bad design in zoekt? Semantically, a line - // always includes a newline as its final byte, but zoekt is effectively - // excluding that final byte from ChunkMatches' `content`, leaving a file's - // trailing newline as inherently unidentifiable. return lines; };