Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: always add extra entry for newLinesIndices #692

Closed
wants to merge 1 commit into from
Closed

Conversation

keegancsmith
Copy link
Member

This was a regression in the recent change. If the file ended in a newline we didn't add an extra index entry, which lead to us returning the "linenum for entry out of range" error.

Test Plan: caught this on my ranking integration tests branch

This was a regression in the recent change. If the file ended in a
newline we didn't add an extra index entry, which lead to us returning
the "linenum for entry out of range" error.

Test Plan: caught this on my ranking integration tests branch
@keegancsmith keegancsmith requested a review from a team November 14, 2023 21:05
@keegancsmith
Copy link
Member Author

@jtibshirani I know you have been deploying new versions of zoekt and monitoring indexing. You may have come across this accidental regression by me. Here is the fix :)

Copy link
Member

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Would it be easy to add a regression test for this, for example just index a file with an extra newline?

@keegancsmith
Copy link
Member Author

hmm, so the behaviour is different from before but this is an example of universal-ctags just outputing incorrect data. I am closing this PR and have an alternative fix here #694

Check universal-ctags says this symbol is on line 22 but line 22 doesn't exist:

$ universal-ctags '--fields=*' --output-format=json main.ts | grep 22
{"_type": "tag", "name": "config", "path": "main.ts", "pattern": "/^export default config$/", "language": "TypeScript", "line": 22, "kind": "constant", "roles": "def"}

$ wc -l main.ts 
21 main.ts

$ tail -n1 main.ts 
export default config

@keegancsmith keegancsmith deleted the k/oob branch November 15, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants