Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-289031: JavaScript refactor Introduce variable action fails

$
0
0
Reporter Vadim Milichev (Distagon) Vadim Milichev (Distagon)
Created Mar 5, 2012 8:08:31 PM
Updated Mar 5, 2012 8:08:31 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Sergey Shkredov (serjic.shkredov)
Subsystem Refactoring
Affected versions No Affected versions
Fixed in build No Fixed in build
In JavaScript editor, VS freezes for a minute or so when trying to 'Introduce Variable' (Ctrl+Alt+V). No code change then. (BTW, where can I find reSharper's .log file for the error details?)

Source code causing the problem (tried to create var for this.options in the show() method):

$.widget(namespace + "." + widgetName, {
	options: {
		tooltipClass: "",
		stripSelector: ".ipOverflowTooltipStrip",
		showDelay: 150,
		onShow: null
	},
	
	// ....

	show: function (e) {
		var target = e.target;

		// if hovering the tooltip, do nothing
		if ((current !== null && current.tooltip[0] === target) || target.is(".ipOverflowTooltip"))
			return;

		this.hide();

		var tw = target.textWidth(),
			w = target.width();

		if (tw > w) {
			var clone = target.clone();
			var off = target.offset/*position*/();

			clone
				.addClass("ipOverflowTooltip")
				.css({
					display: "block",
					position: "absolute",
					top: off.top,
					left: off.left,
					zIndex: getZindex(target) + 456,
					backgroundColor: getBg(target) || "#ffffff",
					opacity: animationPerformance ? 0 : 1
				});

			copyStyle(target, clone);

			if (this.options.tooltipClass)
				clone.addClass(this.options.tooltipClass);

			if (this.options.stripSelector) {
				$(this.options.stripSelector, clone).remove();
				tw = target.textWidth();
				if (tw <= w) {
					clone.remove();
					return;
				}
			}

			var that = this;

			clone
				.height(target.height())
			//.width(tw + 6) // TODO: get rid of this magic number
				.appendTo("body")
				.on({
					mouseout: function () {
						that.hide();
					},
					click: function (cE) {
						target.click();
						cE.stopImmediatePropagation();
						return false;
					}
				});

			if (this.options.onShow) {
				if (this.options.onShow() === false) {
					this.hide();
					return;
				}
			}

			current = this;
			this.tooltip = clone;

			clone.animate({ opacity: 1 }, animationPerformance ? this.options.showDelay : 0);
		}
	}
	
	// ....
});


Thanks

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>