-
Notifications
You must be signed in to change notification settings - Fork 326
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 go to defintion for Sbt's Scala sources #1984
Conversation
pos => { | ||
new LspPosition(pos.getLine() - 1, pos.getCharacter() - ident.size) | ||
}, | ||
filterOutLocations = { loc => loc.getUri().isWorksheet } |
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.
we shouldn't adjust positions outside of the worksheets.
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.
🤔 not work for now, but I'm wondering for clarity in the future if we should try to unify where we have adjustments done. For example we check here for worksheets and sbt and adjust accordingly. However, Ammonite also has some adjustments that we do, but those live in Ammonite.scala
. I can see how that could be confusing from someone on the outside. Or, is it a good distinction to have that adjustments related to the PC are in AdjustLspData
and other things live in their corresponding places? What do you think?
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.
Yeah, I will move the adjustments to separate locations
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.
Just a question and a nitpick.
@@ -77,6 +72,24 @@ trait AdjustLspData { | |||
} | |||
} | |||
|
|||
case class AdjustLspPos( |
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.
I normally don't love case classes that are verbs. What do you think of AdjustedLspPos
?
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.
Fixed!
pos => { | ||
new LspPosition(pos.getLine() - 1, pos.getCharacter() - ident.size) | ||
}, | ||
filterOutLocations = { loc => loc.getUri().isWorksheet } |
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.
🤔 not work for now, but I'm wondering for clarity in the future if we should try to unify where we have adjustments done. For example we check here for worksheets and sbt and adjust accordingly. However, Ammonite also has some adjustments that we do, but those live in Ammonite.scala
. I can see how that could be confusing from someone on the outside. Or, is it a good distinction to have that adjustments related to the PC are in AdjustLspData
and other things live in their corresponding places? What do you think?
40c6860
to
7fec10e
Compare
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. LGTM!
Fixes #1981