Disable ReSharper 6 Javascript code reformatting

While testing the latest ReSharper 6 EAP build, I'm having trouble with getting R# to play nice with my JS code formatting convention (heavily based on ExtJS conventions). Is there a way to disable automatic code reformatting (which reformats code as you type) for Javascript files?

Thanks in advance for your help,
Petr K.

7 comments

Hello Petr,

Could you please check if suspending ReSharper under Tools | Options | ReSharper
| General helps to avoid automatic formatting of JavaScript while you type?
Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

While testing the latest ReSharper 6 EAP build, I'm having trouble
with getting R# to play nice with my JS code formatting convention
(heavily based on ExtJS conventions). Is there a way to disable
automatic code reformatting (which reformats code as you type) for
Javascript files?

Thanks in advance for your help,
Petr K.
---
Original message URL:
http://devnet.jetbrains.net/message/5302676#5302676



0

I guess it does, but I do not want to lose all ReSharper's capabilities and coding inspections, just the automatic formatting in JS. The trouble with automatic formatting is that it formats code in a weird way in many scenarios, which are common when working with ExtJS, like creating new "javascript classes" using ExtJS syntax, etc. I believe similar issues will arise in other javascript frameworks. I tried fiddling with Resharper's Javascript formatting settings, but were not able to accomplish desired formatting with them. That's why I asked whether disabling of (and only of) Javascript reformatting can be done.

0

I believe best way to resolve the issue is to support required formatting
variations in JS instead of suppressing formatting. ReSharper is generating
quite a number of code during operations, and when it does so it should have
some information about how whitespace is generated. So suppressing autoformatting
won't help much anyway.
Could you please describe the style you want and what options you are missing?

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> I guess it does, but I do not want to lose all ReSharper's
IR> capabilities and coding inspections, just the automatic formatting
IR> in JS. The trouble with automatic formatting is that it formats code
IR> in a weird way in many scenarios, which are common when working with
IR> ExtJS, like creating new "javascript classes" using ExtJS syntax,
IR> etc. I believe similar issues will arise in other javascript
IR> frameworks. I tried fiddling with Resharper's Javascript formatting
IR> settings, but were not able to accomplish desired formatting with
IR> them. That's why I asked whether disabling of (and only of)
IR> Javascript reformatting can be done.
IR>
IR> ---
IR> Original message URL:
IR> http://devnet.jetbrains.net/message/5302722#5302722


0

Hi,

I simply can't find a way to adjust resharper to behave the way I want. Here is an example:

'#BGInfo').autoResize({
          onResize: function () {
               $(this).css({ opacity: 0.8 });
          },
          animateCallback: function () {
               $(this).css({ opacity: 1 });
          },
          animateDuration: 150,
          extraSpace: 0,
          limit: 260
     })

When I put the semicolon at the last line, it becomes:
'#BGInfo').autoResize({
               onResize: function() {
                    $(this).css({ opacity: 0.8 });
               },
               animateCallback: function() {
                    $(this).css({ opacity: 1 });
               },
               animateDuration: 150,
               extraSpace: 0,
               limit: 260
          });

How can I prevent this behaviour and make it put the rest of the code just one space indented after the first line and make the closing brackets match the dollar sign?
0

Hello,

I've raised an issue in our tracker: http://youtrack.jetbrains.net/issue/RSRP-273851
and you're welcome to vote for it. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

http://devnet.jetbrains.net/message/5309041#5309041



0

That is quick and really well explained. Thank you.

Hope it gets fixed quick. Good luck^^

0

I'm using ReSharper 6.1 - where in the options can I disable JavaScript autocompletion and autoformatting?

EDIT: oops replied to wrong post, sorry!


0

Please sign in to leave a comment.