1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-12-10 10:40:07 +02:00

Включение постоянного вывода описания в списке подсказок #119

This commit is contained in:
salexdv 2021-05-17 09:22:16 +03:00
parent 6ae145a860
commit 18bee1e9d6
2 changed files with 19 additions and 1 deletions

View File

@ -21,3 +21,10 @@
color: #fff;
}
.suggest-widget .monaco-list .monaco-list-row .inactive-detail {
display: inline !important;
color: #b3b3b3;
}

View File

@ -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');
}
}
}