diff --git a/src/decorations.css b/src/decorations.css index 38e761f..ddea8b2 100644 --- a/src/decorations.css +++ b/src/decorations.css @@ -20,4 +20,11 @@ background: #028fef; color: #fff; +} + +.suggest-widget .monaco-list .monaco-list-row .inactive-detail { + + display: inline !important; + color: #b3b3b3; + } \ No newline at end of file diff --git a/src/editor.js b/src/editor.js index ea261fe..4c310ef 100644 --- a/src/editor.js +++ b/src/editor.js @@ -807,7 +807,9 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit } - enableSuggestActivationEvent = function(enabled) { + enableSuggestActivationEvent = function(enabled, alwaysDisplayDetails = false) { + + editor.alwaysDisplaySuggestDetails = alwaysDisplayDetails; if (suggestObserver != null) { suggestObserver.disconnect(); @@ -825,8 +827,17 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit let element = mutation.addedNodes[0]; if (element.classList.contains('monaco-list-row') && element.classList.contains('focused')) { + let rows = getSuggestWidgetRows(element); genarateEventWithSuggestData('EVENT_ON_ACTIVATE_SUGGEST_ROW', rows, 'focus', element.getAttribute('aria-label')); + + if (editor.alwaysDisplaySuggestDetails) { + document.querySelectorAll('.monaco-list-rows .details-label').forEach(function (node) { + node.classList.add('inactive-detail'); + }); + document.querySelector('.monaco-list-rows .focused .details-label').classList.remove('inactive-detail'); + } + } }