@@ -17,7 +17,7 @@ import {
1717} from './hoverifier'
1818import { findPositionsFromEvents , SupportedMouseEvent } from './positions'
1919import { CodeViewProps , DOM } from './testutils/dom'
20- import { createHoverAttachment , createStubActionsFetcher , createStubHoverFetcher } from './testutils/fixtures'
20+ import { createHoverAttachment , createStubActionsProvider , createStubHoverProvider } from './testutils/fixtures'
2121import { dispatchMouseEventAtPositionImpure } from './testutils/mouse'
2222import { HoverAttachment , LOADING } from './types'
2323
@@ -43,8 +43,8 @@ describe('Hoverifier', () => {
4343 closeButtonClicks : NEVER ,
4444 hoverOverlayElements : of ( null ) ,
4545 hoverOverlayRerenders : EMPTY ,
46- fetchHover : createStubHoverFetcher ( { range : hoverRange } , LOADER_DELAY + delayTime ) ,
47- fetchActions : ( ) => of ( null ) ,
46+ getHover : createStubHoverProvider ( { range : hoverRange } , LOADER_DELAY + delayTime ) ,
47+ getActions : ( ) => of ( null ) ,
4848 } )
4949
5050 const positionJumps = new Subject < PositionJump > ( )
@@ -104,8 +104,8 @@ describe('Hoverifier', () => {
104104 closeButtonClicks : NEVER ,
105105 hoverOverlayElements : of ( null ) ,
106106 hoverOverlayRerenders : EMPTY ,
107- fetchHover : createStubHoverFetcher ( hover , delayTime ) ,
108- fetchActions : createStubActionsFetcher ( [ 'foo' , 'bar' ] , delayTime ) ,
107+ getHover : createStubHoverProvider ( hover , delayTime ) ,
108+ getActions : createStubActionsProvider ( [ 'foo' , 'bar' ] , delayTime ) ,
109109 } )
110110
111111 const positionJumps = new Subject < PositionJump > ( )
@@ -193,11 +193,11 @@ describe('Hoverifier', () => {
193193 hoverOverlayElements : of ( null ) ,
194194 hoverOverlayRerenders : EMPTY ,
195195 // Only show on line 24, not line 25 (which is the 2nd click event below).
196- fetchHover : position =>
197- position . line === 24 ? createStubHoverFetcher ( { } , delayTime ) ( position ) : of ( null ) ,
198- fetchActions : position =>
196+ getHover : position =>
197+ position . line === 24 ? createStubHoverProvider ( { } , delayTime ) ( position ) : of ( null ) ,
198+ getActions : position =>
199199 position . line === 24
200- ? createStubActionsFetcher ( [ 'foo' , 'bar' ] , delayTime ) ( position )
200+ ? createStubActionsProvider ( [ 'foo' , 'bar' ] , delayTime ) ( position )
201201 : of ( null ) ,
202202 } )
203203
@@ -265,10 +265,9 @@ describe('Hoverifier', () => {
265265 hoverOverlayElements : of ( null ) ,
266266 hoverOverlayRerenders : EMPTY ,
267267 // Only show on line 24, not line 25 (which is the 2nd click event below).
268- fetchHover : position =>
269- position . line === 24 ? createStubHoverFetcher ( { } ) ( position ) : of ( null ) ,
270- fetchActions : position =>
271- position . line === 24 ? createStubActionsFetcher ( [ 'foo' , 'bar' ] ) ( position ) : of ( null ) ,
268+ getHover : position => ( position . line === 24 ? createStubHoverProvider ( { } ) ( position ) : of ( null ) ) ,
269+ getActions : position =>
270+ position . line === 24 ? createStubActionsProvider ( [ 'foo' , 'bar' ] ) ( position ) : of ( null ) ,
272271 } )
273272
274273 const positionJumps = new Subject < PositionJump > ( )
@@ -345,8 +344,8 @@ describe('Hoverifier', () => {
345344 closeButtonClicks : new Observable < MouseEvent > ( ) ,
346345 hoverOverlayElements : of ( null ) ,
347346 hoverOverlayRerenders : EMPTY ,
348- fetchHover : createStubHoverFetcher ( hover , LOADER_DELAY + hoverDelayTime ) ,
349- fetchActions : createStubActionsFetcher ( actions , LOADER_DELAY + actionsDelayTime ) ,
347+ getHover : createStubHoverProvider ( hover , LOADER_DELAY + hoverDelayTime ) ,
348+ getActions : createStubActionsProvider ( actions , LOADER_DELAY + actionsDelayTime ) ,
350349 } )
351350
352351 const positionJumps = new Subject < PositionJump > ( )
@@ -416,8 +415,8 @@ describe('Hoverifier', () => {
416415 closeButtonClicks : new Observable < MouseEvent > ( ) ,
417416 hoverOverlayElements : of ( null ) ,
418417 hoverOverlayRerenders : EMPTY ,
419- fetchHover : createStubHoverFetcher ( hover ) ,
420- fetchActions : ( ) => of ( null ) ,
418+ getHover : createStubHoverProvider ( hover ) ,
419+ getActions : ( ) => of ( null ) ,
421420 } )
422421
423422 const positionJumps = new Subject < PositionJump > ( )
@@ -477,8 +476,8 @@ describe('Hoverifier', () => {
477476 closeButtonClicks : new Observable < MouseEvent > ( ) ,
478477 hoverOverlayElements : of ( null ) ,
479478 hoverOverlayRerenders : EMPTY ,
480- fetchHover : createStubHoverFetcher ( hover ) ,
481- fetchActions : ( ) => of ( null ) ,
479+ getHover : createStubHoverProvider ( hover ) ,
480+ getActions : ( ) => of ( null ) ,
482481 } )
483482
484483 const positionJumps = new Subject < PositionJump > ( )
@@ -533,7 +532,7 @@ describe('Hoverifier', () => {
533532 /**
534533 * This test ensures that the adjustPosition options is being called in the ways we expect. This test is actually not the best way to ensure the feature
535534 * works as expected. This is a good example of a bad side effect of how the main `hoverifier.ts` file is too tightly integrated with itself. Ideally, I'd be able to assert
536- * 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 `ActionsFetcher `s
535+ * that the effected positions have actually been adjusted as intended but this is impossible with the current implementation. We can assert that the `HoverProvider ` and `ActionsProvider `s
537536 * have the adjusted positions (AdjustmentDirection.CodeViewToActual). However, we cannot reliably assert that the code "highlighting" the token has the position adjusted (AdjustmentDirection.ActualToCodeView).
538537 */
539538 /**
@@ -546,8 +545,8 @@ describe('Hoverifier', () => {
546545 scheduler . run ( ( { cold, expectObservable } ) => {
547546 const adjustmentDirections = new Subject < AdjustmentDirection > ( )
548547
549- const fetchHover = createStubHoverFetcher ( { } )
550- const fetchActions = createStubActionsFetcher ( [ 'foo' , 'bar' ] )
548+ const getHover = createStubHoverProvider ( { } )
549+ const getActions = createStubActionsProvider ( [ 'foo' , 'bar' ] )
551550
552551 const adjustPosition : PositionAdjuster < { } > = ( { direction, position } ) => {
553552 adjustmentDirections . next ( direction )
@@ -559,8 +558,8 @@ describe('Hoverifier', () => {
559558 closeButtonClicks : new Observable < MouseEvent > ( ) ,
560559 hoverOverlayElements : of ( null ) ,
561560 hoverOverlayRerenders : EMPTY ,
562- fetchHover ,
563- fetchActions ,
561+ getHover ,
562+ getActions ,
564563 } )
565564
566565 const positionJumps = new Subject < PositionJump > ( )
0 commit comments