-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix a regression where the SCIP index contained invalid symbols #570
Conversation
Uploading an index with scip-java v0.8.17 results in the following error in the Sourcegraph UI ``` codeNavSvc.GetImplementations: lsifStore.MonikersByPosition: reached end of symbol while parsing <scheme>, expected a ' ' character minimized/Issue413Subclass#c. _____________________________^ ``` The problem is that this release introduced a regression where scip-java emitted invalid SCIP symbols. This PR fixes the issue, and adds new checks in the testing infrastructure to prevent this kind of regression from happening again.
scipSymbol.split(" ", 5) match { | ||
case Array( | ||
scheme, | ||
packageManager, | ||
packageName, | ||
packageVersion, | ||
descriptor | ||
) => | ||
GlobalScipSymbol( | ||
scheme, | ||
packageManager, | ||
packageName, | ||
packageVersion, | ||
parseDescriptors(descriptor) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are targeting 2.13, I think you can use direct matching on a string here?
scipSymbol.split(" ", 5) match { | |
case Array( | |
scheme, | |
packageManager, | |
packageName, | |
packageVersion, | |
descriptor | |
) => | |
GlobalScipSymbol( | |
scheme, | |
packageManager, | |
packageName, | |
packageVersion, | |
parseDescriptors(descriptor) | |
) | |
scipSymbol match { | |
case s"$scheme $packageManager $packageName $packageVersion $descriptor" => | |
GlobalScipSymbol( | |
scheme, | |
packageManager, | |
packageName, | |
packageVersion, | |
parseDescriptors(descriptor) | |
) |
I would check but my local is broken again. It's ridiculous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as a stop gap solution, but IMO we should do some light refactoring and separate symbols properly: #573
Uploading an index with scip-java v0.8.17 results in the following error in the Sourcegraph UI
The problem is that this release introduced a regression where scip-java emitted invalid SCIP symbols. This PR fixes the issue, and adds new checks in the testing infrastructure to prevent this kind of regression from happening again.
Test plan
See updated snapshots.