Bug 5794 - Indentations does not work in JSScrpit
Summary: Indentations does not work in JSScrpit
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 3.0.x
Hardware: PC Windows
: Lowest enhancement
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-06-21 05:53 UTC by Shawn Lewis
Modified: 2014-02-12 03:07 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Shawn Lewis 2012-06-21 05:53:52 UTC
Whether I set the indentation mode to Automatic or Smart, it seems nothing different with setting to None.

In my opinion ,for example , if I enter a "Return" key after a "{ ", the cursor will jump to the next line and a indentation will be added to the beginning of the new line automatically.

Can we achieve that?
Comment 1 Mike Krüger 2012-06-22 01:19:32 UTC
If someone implements it for java script - atm we don't support this language.
Comment 2 Draco18s 2012-07-04 14:13:52 UTC
How can you not support js?  Code indentation in js is identical to any other C related language: C, C++, C#, java, ActionScript, etc.

It's really freaking simple and is the MAJOR turn off for me having to self-indent my own code.
Comment 3 Mike Krüger 2012-07-05 02:48:06 UTC
MD is free software, if enough people are interrested in js support then it's likely that it'll get contributed.
In the core team there is atm no demand for js.

Some people want F#, iron python, vb.net - but with our limited resources we can only really support c#. The C/C++ support was contributed as well (and is not near the C# support atm).
Comment 4 Draco18s 2012-07-05 09:36:55 UTC
How bloody difficult is it to implement some language agnostic rules?

Always tab in after { always remove a tab after }.  Done.

That's seriously all you need to stop pissing people off.

Hell, do it like Flash does and let people set their own preferences:

In a related vein of thought: I was sure that an older version of MD did indentation just fine, but as I can no longer locate that version of MD I don't know what version it was (just that when I upgraded from Unity 2 to Unity 3, the new MD I got did not do what I wanted, but the old version had).
Comment 5 Mike Krüger 2014-02-12 03:07:51 UTC
It's not easy to do it language agnostic - {} tabbing is just the first step.

c# needs to take care of the pre processor, key words several indentation styles & formatting settings for different levels and so on.

It would not be hard to make a .js indentation based on our .cs indentation - basically it's almost the same language but some language specific things need always be taken into account for any 'C' like language.

I set that to 'wontfix' because we (xamarin) have atm no xxxScript support in any of our offerings. If that changes we'll provide indentation & formatting for that language.