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

Integrating SoftParser: Go-to-definition code provider for SoftAST #360

Merged
merged 8 commits into from
Jan 30, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ object TestCodeProvider {

/** Executes go-to-definition providers for both StrictAST and [[SoftAST]] */
def goToDefinition(settings: GoToDefSetting = testGoToDefSetting)(code: String): List[(URI, LineRange)] = {
goToDefinitionStrict(settings)(code)
goToDefinitionSoft(settings)(code)
val resultStrict = goToDefinitionStrict(settings)(code)
val resultStrictRanges = resultStrict.map(_._2)

val resultSoft = goToDefinitionSoft(settings)(code)
val resultSoftRanges = resultSoft.map(_._2)

// Assert that both go-to-def services (Strict & Soft) return the same result.
resultSoftRanges should contain theSameElementsAs resultStrictRanges
// return either one of the results because they both contain the same result
resultSoft
Copy link
Member

Choose a reason for hiding this comment

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

👍

}

def goToDefinitionForAll(
Expand Down