-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add optional position adjuster to HoverifierOptions #38
Conversation
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 64.13% 65.24% +1.11%
==========================================
Files 15 15
Lines 566 587 +21
Branches 146 155 +9
==========================================
+ Hits 363 383 +20
- Misses 203 204 +1
Continue to review full report at Codecov.
|
chrismwendt
left a comment
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 couple nitpicks
src/hoverifier.test.ts
Outdated
| * that the effected positions have actually been adjusted as intended but this is impossible with the current implementation. We can assert that the `HoverFetcher` and `JumpURLFetcher`s | ||
| * have the adjusted positions (AdjustmentDirection.CodeViewToActual). However, we cannot reliably assert that the code "highlighting" the token has the position adjusted (AdjustmentDirection.ActualToCodeView). | ||
| */ | ||
| it('PositionAdjuster gets called when expecteds', () => { |
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.
"expected"?
|
|
||
| const inputDiagram = 'ab' | ||
| // There is probably a bug in code that is unrelated to this feature that is causing the PositionAdjuster to be called an extra time. | ||
| const outputDiagram = 'a(ba)' |
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.
What should this diagram look like if there were no bug, or is there an issue for this?
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'll add to the comment, but it should be -(ba). Since its a(ba), and a is the direction that adjustPosition gets called with when we're getting the position the token is in the dom(not vcs), I'm assuming that we're calling the highlight logic immediately and then the two expected calls are getting called on the next tick.
| })) | ||
| ) | ||
| : of({ adjustPosition, codeView, resolveContext, position, ...rest }) | ||
| ), |
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.
It looks like map could be used in place of switchMap
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.
adjustPosition returns an observable so I need to use switchMap to flatten it into just its output.
|
🎉 This PR is included in version 3.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.