Javascript Indenting

7 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 08 Aug 2011 Link to this post

    Whats the option to turn of the auto-indent in javascript (only)...it's making some seriously BAD choices still with jQuery causing me more keystrokes to re-re-format it
  2. Derek
    Derek avatar
    9 posts
    Member since:
    Mar 2009

    Posted 10 Aug 2011 Link to this post

    I second that. It is indenting everything in scope of the function it relates to, instead of following logical block formatting. So you end up with ...


    declaration ( param, param, function () { 
                   code
    code ( param, param, function () { 
    code
    code
    }),
     });

    this quickly becomes out of control and hard to read, especially when you begin nesting async statements.

    It would be a lot better if we could just follow block formatting, and go with ...

    declaration ( param, param, function() {
    code
    code ( param, param, function () {
    code
    code
    })
    });
  3. DevCraft banner
  4. Kaloyan
    Admin
    Kaloyan avatar
    82 posts

    Posted 11 Aug 2011 Link to this post

    Hello guys,

    We're familiar with the issues javascript formatter currently has, and we're planning some heavy rework and adding lots of new stuff to it for the November release. So, stay tuned and follow our internal builds for updates on the topic.

    As for Steve's question, you can disable JC's javascript autoformat from the options dialog -> Code Style -> JavaScrpt -> General page. There's a bunch of settings for the javascript formatter in Visual Studio options also (Options -> Text Editor -> JScript -> Formatting), so you can check whether these will do the magic for you.

    Cheers,
    Kaloyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 Aug 2011 Link to this post

    Oh good!  Thanks much Kaloyan

    Will the Nov release also address the "unintelligent" doublequote\braces?

    Like take this...
    string name = steve";

    So when you add the quote to the beginning of the string this happens
    string name = ""steve";

    (braces are the same)

    They should be more aware of context
  6. Kaloyan
    Admin
    Kaloyan avatar
    82 posts

    Posted 15 Aug 2011 Link to this post

    Hello Steve,

    We'll, for sure, do our best to improve that behavior for the Nov release. Added that to our product backlog. Thanks for the suggestion.

    Regards,
    Kaloyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  7. Derek
    Derek avatar
    9 posts
    Member since:
    Mar 2009

    Posted 17 Aug 2011 Link to this post

    Following your steps to disable the auto-formatting in 'just' Javascript did not work for me. I either have to turn Typing Assistance off system-wide, or it continues to mess up my javascript.
  8. Kaloyan
    Admin
    Kaloyan avatar
    82 posts

    Posted 19 Aug 2011 Link to this post

    Hi Derek,

    We've recently stumbled upon a deficiency with our typing assistance, that manifested in formatting the whole file, instead of a single line, on which a semicolon was typed. We've already taken care of that and the fix will be available with our next internal build some time next week, so stay tuned.

    Greetings,
    Kaloyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top
DevCraft banner