Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

added show on cursor over for datatip #1626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class DatatipManagerForEditor {
_interactedWith: boolean;
_checkedScrollable: boolean;
_isScrollable: boolean;
_showOnCursorOver: boolean;

constructor(
editor: atom$TextEditor,
Expand All @@ -276,6 +277,7 @@ class DatatipManagerForEditor {
this._lastHiddenTime = 0;
this._lastFetchedFromCursorPosition = false;
this._shouldDropNextMouseMoveAfterFocus = false;
this._showOnCursorOver = false;

this._subscriptions.add(
featureConfig.observe('atom-ide-datatip.datatipDebounceDelay', () =>
Expand All @@ -285,6 +287,9 @@ class DatatipManagerForEditor {
'atom-ide-datatip.datatipInteractedWithDebounceDelay',
() => this._setHideIfOutsideDebounce(),
),
featureConfig.observe('atom-ide-datatip.showDatatipOnCursorOver', e => {
this._showOnCursorOver = e;
}),
Observable.fromEvent(this._editorView, 'focus').subscribe(e => {
this._shouldDropNextMouseMoveAfterFocus = true;
if (!this._insideDatatip) {
Expand Down Expand Up @@ -343,6 +348,9 @@ class DatatipManagerForEditor {
}
}),
Observable.fromEvent(this._editorView, 'keyup').subscribe(e => {
if (this._showOnCursorOver) {
this._startFetching(() => this._editor.getCursorBufferPosition());
}
const modifierKey = getModifierKeyFromKeyboardEvent(e);
if (modifierKey) {
this._heldKeys.delete(modifierKey);
Expand Down
6 changes: 6 additions & 0 deletions modules/atom-ide-ui/pkg/atom-ide-datatip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"description": "Display only the highest priority datatip on hover.",
"type": "boolean",
"default": false
},
"showDatatipOnCursorOver": {
"title": "Display datatip on cursor over",
"description": "This adds the behavior similar to atom-linter when moving the cursor over a datatip marker automatically displays the tip.",
"type": "boolean",
"default": false
}
},
"providedServices": {
Expand Down