From 18bee1e9d6cff8e3e04a5fb6667641d4deeb264c Mon Sep 17 00:00:00 2001 From: salexdv Date: Mon, 17 May 2021 09:22:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D1=81=D1=82=D0=BE=D1=8F=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B5=20=D0=BF=D0=BE=D0=B4=D1=81?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D0=BE=D0=BA=20#119?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/decorations.css | 7 +++++++ src/editor.js | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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'); + } + } }