Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Resharper stop Javascript autocompleting $ as '$t?

When I call jQuery methods like jQuery.ajax I use $.ajax. Resharper is picking up something from jqGrid's code that makes it want to autocomplete $t whenever I type $. Its making jQuery coding REALLY slow - does anyone know how I can disable that?

UPDATE

I know its possible to totally suspend Resharper from Tools -> Options -> Resharper -> General -> Suspend, but I really just want it to leave my javscript alone ;(

like image 366
Jimbo Avatar asked Nov 05 '22 12:11

Jimbo


1 Answers

I suppose that somewhere in your code or in the code of jqGrid the global variable $t are defined. The code of jqGrid has many places like

methodName: function (methodParameters) {
    return this.each(function () {
        var $t = this, ...
        ...
    });
}

So there are many places where local variable $t are defined. Inside of other methods you will see var t = this or var ts = this or var self = this and so on.

So I suppose, that somewhere in the code of jqGrid which you use there are cup & pasted error: one copied the code from the function having var $t = this defined in the other method where one used another variable name to save this. So the $t will be interpret as global variable.

I recommend you to find the definition of the $t in your code. Just press F12 on $t or use another possibilities of Resharper to find where the global $t variable are defined.

like image 110
Oleg Avatar answered Nov 14 '22 01:11

Oleg