Skip to content

Commit 86bcd6f

Browse files
committed
chore: format
1 parent 1050929 commit 86bcd6f

File tree

3 files changed

+60
-93
lines changed

3 files changed

+60
-93
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
package.json
32
package-lock.json
43
pnpm-lock.yaml
54
coverage

lib/datatip-manager.ts

Lines changed: 53 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,86 +14,63 @@ import { ProviderRegistry } from "atom-ide-base/commons-atom/ProviderRegistry"
1414
import { makeOverlaySelectable } from "atom-ide-base/commons-ui/float-pane/selectable-overlay"
1515

1616
export class DataTipManager {
17-
/**
18-
* holds a reference to disposable items from this data tip manager
19-
*/
17+
/** Holds a reference to disposable items from this data tip manager */
2018
subscriptions: CompositeDisposable = new CompositeDisposable()
2119

22-
/**
23-
* holds a list of registered data tip providers
24-
*/
20+
/** Holds a list of registered data tip providers */
2521
providerRegistry: ProviderRegistry<DatatipProvider> = new ProviderRegistry()
2622

27-
/**
28-
* holds a weak reference to all watched Atom text editors
29-
*/
23+
/** Holds a weak reference to all watched Atom text editors */
3024
watchedEditors: WeakSet<TextEditor> = new WeakSet()
3125

32-
/**
33-
* holds a reference to the current watched Atom text editor
34-
*/
26+
/** Holds a reference to the current watched Atom text editor */
3527
editor: TextEditor | null = null
3628

37-
/**
38-
* holds a reference to the current watched Atom text editor viewbuffer
39-
*/
29+
/** Holds a reference to the current watched Atom text editor viewbuffer */
4030
editorView: TextEditorElement | null = null
4131

42-
/**
43-
* holds a reference to all disposable items for the current watched Atom text editor
44-
*/
32+
/** Holds a reference to all disposable items for the current watched Atom text editor */
4533
editorSubscriptions: CompositeDisposable | null = null
4634

47-
/**
48-
* holds a reference to all disposable items for the current data tip
49-
*/
35+
/** Holds a reference to all disposable items for the current data tip */
5036
dataTipMarkerDisposables: CompositeDisposable | null = null
5137

52-
/**
53-
* config flag denoting if the data tip should be shown when moving the cursor on screen
54-
*/
38+
/** Config flag denoting if the data tip should be shown when moving the cursor on screen */
5539
showDataTipOnCursorMove = false
5640

57-
/**
58-
* config flag denoting if the data tip should be shown when moving the mouse cursor around
59-
*/
41+
/** Config flag denoting if the data tip should be shown when moving the mouse cursor around */
6042
showDataTipOnMouseMove = true
6143

62-
/**
63-
* holds the range of the current data tip to prevent unnecessary show/hide calls
64-
*/
44+
/** Holds the range of the current data tip to prevent unnecessary show/hide calls */
6545
currentMarkerRange: Range | null = null
6646

6747
/**
68-
* to optimize show/hide calls we set a timeout of hoverTime for the mouse movement
69-
* only if the mouse pointer is not moving for more than hoverTime the data tip functionality is triggered
48+
* To optimize show/hide calls we set a timeout of hoverTime for the mouse movement only if the mouse pointer is not
49+
* moving for more than hoverTime the data tip functionality is triggered
7050
*/
7151
mouseMoveTimer: NodeJS.Timeout | null = null
7252

7353
/**
74-
* to optimize show/hide calls we set a timeout of hoverTime for the cursor movement
75-
* only if the cursor is not moving for more than hoverTime the data tip functionality is triggered
54+
* To optimize show/hide calls we set a timeout of hoverTime for the cursor movement only if the cursor is not moving
55+
* for more than hoverTime the data tip functionality is triggered
7656
*/
7757
cursorMoveTimer: NodeJS.Timeout | null = null
7858

79-
/** The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is still shown when the mouse/cursor moves [ms]. */
59+
/**
60+
* The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is
61+
* still shown when the mouse/cursor moves [ms].
62+
*/
8063
hoverTime = atom.config.get("atom-ide-datatip.hoverTime")
8164

8265
constructor() {
83-
/**
84-
* the mouse move event handler that evaluates the screen position and eventually shows a data tip
85-
*/
66+
/** The mouse move event handler that evaluates the screen position and eventually shows a data tip */
8667
this.onMouseMoveEvt = this.onMouseMoveEvt.bind(this)
8768

88-
/**
89-
* the cursor move event handler that evaluates the cursor position and eventually shows a data tip
90-
*/
69+
/** The cursor move event handler that evaluates the cursor position and eventually shows a data tip */
9170
this.onCursorMoveEvt = this.onCursorMoveEvt.bind(this)
9271
}
9372

94-
/**
95-
* initialization routine retrieving a reference to the markdown service
96-
*/
73+
/** Initialization routine retrieving a reference to the markdown service */
9774
initialize() {
9875
this.subscriptions.add(
9976
atom.workspace.observeTextEditors((editor) => {
@@ -120,9 +97,7 @@ export class DataTipManager {
12097
)
12198
}
12299

123-
/**
124-
* dispose function to clean up any disposable references used
125-
*/
100+
/** Dispose function to clean up any disposable references used */
126101
dispose() {
127102
if (this.dataTipMarkerDisposables) {
128103
this.dataTipMarkerDisposables.dispose()
@@ -139,16 +114,15 @@ export class DataTipManager {
139114
}
140115
}
141116

142-
/**
143-
* returns the provider registry as a consumable service
144-
*/
117+
/** Returns the provider registry as a consumable service */
145118
get datatipService() {
146119
return this.providerRegistry
147120
}
148121

149122
/**
150-
* checks and setups an Atom Text editor instance for tracking cursor/mouse movements
151-
* @param editor a valid Atom Text editor instance
123+
* Checks and setups an Atom Text editor instance for tracking cursor/mouse movements
124+
*
125+
* @param editor A valid Atom Text editor instance
152126
*/
153127
watchEditor(editor: TextEditor) {
154128
if (this.watchedEditors.has(editor)) {
@@ -182,9 +156,9 @@ export class DataTipManager {
182156
}
183157

184158
/**
185-
* updates the internal references to a specific Atom Text editor instance in case
186-
* it has been decided to track this instance
187-
* @param editor the Atom Text editor instance to be tracked
159+
* Updates the internal references to a specific Atom Text editor instance in case it has been decided to track this instance
160+
*
161+
* @param editor The Atom Text editor instance to be tracked
188162
*/
189163
updateCurrentEditor(editor: TextEditor | null) {
190164
if (editor === this.editor) {
@@ -229,8 +203,9 @@ export class DataTipManager {
229203
}
230204

231205
/**
232-
* the central cursor movement event handler
233-
* @param evt the cursor move event
206+
* The central cursor movement event handler
207+
*
208+
* @param evt The cursor move event
234209
*/
235210
onCursorMoveEvt(event: CursorPositionChangedEvent) {
236211
if (this.cursorMoveTimer) {
@@ -253,9 +228,7 @@ export class DataTipManager {
253228
)
254229
}
255230

256-
/**
257-
* the central mouse movement event handler
258-
*/
231+
/** The central mouse movement event handler */
259232
onMouseMoveEvt(event: MouseEvent) {
260233
if (this.mouseMoveTimer) {
261234
clearTimeout(this.mouseMoveTimer)
@@ -299,8 +272,9 @@ export class DataTipManager {
299272
}
300273

301274
/**
302-
* the central command event handler
303-
* @param evt command event
275+
* The central command event handler
276+
*
277+
* @param evt Command event
304278
*/
305279
onCommandEvt(evt: CommandEvent<TextEditorElement>) {
306280
const editor = evt.currentTarget.getModel()
@@ -318,11 +292,12 @@ export class DataTipManager {
318292
}
319293

320294
/**
321-
* evaluates the responsible DatatipProvider to call for data tip information at a given position in a specific Atom Text editor
322-
* @param editor the Atom Text editor instance to be used
323-
* @param position the cursor or mouse position within the text editor to qualify for a data tip
324-
* @param evt the original event triggering this data tip evaluation
325-
* @return a promise object to track the asynchronous operation
295+
* Evaluates the responsible DatatipProvider to call for data tip information at a given position in a specific Atom Text editor
296+
*
297+
* @param editor The Atom Text editor instance to be used
298+
* @param position The cursor or mouse position within the text editor to qualify for a data tip
299+
* @param evt The original event triggering this data tip evaluation
300+
* @returns A promise object to track the asynchronous operation
326301
*/
327302
async showDataTip(editor: TextEditor, position: Point): Promise<void> {
328303
try {
@@ -412,12 +387,13 @@ export class DataTipManager {
412387
}
413388

414389
/**
415-
* mounts / displays a data tip view component at a specific position in a given Atom Text editor
416-
* @param editor the Atom Text editor instance to host the data tip view
417-
* @param range the range for which the data tip component is valid
418-
* @param position the position on which to show the data tip view
419-
* @param view the data tip component to display
420-
* @return a composite object to release references at a later stage
390+
* Mounts / displays a data tip view component at a specific position in a given Atom Text editor
391+
*
392+
* @param editor The Atom Text editor instance to host the data tip view
393+
* @param range The range for which the data tip component is valid
394+
* @param position The position on which to show the data tip view
395+
* @param view The data tip component to display
396+
* @returns A composite object to release references at a later stage
421397
*/
422398
mountDataTipWithMarker(
423399
editor: TextEditor,
@@ -497,9 +473,7 @@ export class DataTipManager {
497473
return disposables
498474
}
499475

500-
/**
501-
* unmounts / hides the most recent data tip view component
502-
*/
476+
/** Unmounts / hides the most recent data tip view component */
503477
unmountDataTip() {
504478
this.currentMarkerRange = null
505479
this.dataTipMarkerDisposables?.dispose()
@@ -508,8 +482,9 @@ export class DataTipManager {
508482
}
509483

510484
/**
511-
* handles the mouse wheel event to enable scrolling over long text
512-
* @param evt the mouse wheel event being triggered
485+
* Handles the mouse wheel event to enable scrolling over long text
486+
*
487+
* @param evt The mouse wheel event being triggered
513488
*/
514489
function onMouseWheel(evt: WheelEvent) {
515490
evt.stopPropagation()

lib/main.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@ import type { DatatipService } from "atom-ide-base"
44

55
export { default as config } from "./config.json"
66

7-
/**
8-
* [subscriptions description]
9-
*/
7+
/** [subscriptions description] */
108
let subscriptions: CompositeDisposable
11-
/**
12-
* [datatipManager description]
13-
*/
9+
/** [datatipManager description] */
1410
let datatipManager: DataTipManager
1511

16-
/**
17-
* called by Atom when activating an extension
18-
*/
12+
/** Called by Atom when activating an extension */
1913
export function activate() {
2014
// Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
2115
subscriptions = new CompositeDisposable()
@@ -39,18 +33,17 @@ async function install_deps() {
3933
}
4034
}
4135

42-
/**
43-
* called by Atom when deactivating an extension
44-
*/
36+
/** Called by Atom when deactivating an extension */
4537
export function deactivate() {
4638
if (subscriptions) {
4739
subscriptions.dispose()
4840
}
4941
}
5042

5143
/**
52-
* called by IDE extensions to retrieve the Datatip service for registration
53-
* @return the current DataTipManager instance
44+
* Called by IDE extensions to retrieve the Datatip service for registration
45+
*
46+
* @returns The current DataTipManager instance
5447
*/
5548
export function provideDatatipService(): DatatipService {
5649
return datatipManager!.datatipService

0 commit comments

Comments
 (0)