Răsfoiți Sursa

HUE-5273 [editor] Show additional details in the tooltip for the context popover

Johan Ahlen 9 ani în urmă
părinte
comite
98a198c45d

+ 8 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3316,7 +3316,14 @@
             if (token !== null && token.parseLocation && !disableTooltip) {
               tooltipTimeout = window.setTimeout(function () {
                 var endCoordinates = editor.renderer.textToScreenCoordinates(pointerPosition.row, token.start);
-                contextTooltip.show(options.contextTooltip, endCoordinates.pageX, endCoordinates.pageY + editor.renderer.lineHeight + 3);
+
+                var tooltipText = options.contextTooltip;
+                if (token.parseLocation.identifierChain) {
+                  tooltipText += ' (' + $.map(token.parseLocation.identifierChain, function (identifier) { return identifier.name }).join('.') + ')';
+                } else if (token.parseLocation.function) {
+                  tooltipText += ' (' + token.parseLocation.function + ')';
+                }
+                contextTooltip.show(tooltipText, endCoordinates.pageX, endCoordinates.pageY + editor.renderer.lineHeight + 3);
               }, 500);
             } else {
               hideContextTooltip();