Skip to content

Commit

Permalink
Remove TODO about extra zoekt newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
isker committed Dec 26, 2023
1 parent 01e0457 commit 5885de4
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/lib/server/content-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,6 @@ Array<Array<ContentToken>> => {
// 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;
};
Expand Down

0 comments on commit 5885de4

Please sign in to comment.