code-formatting

Format HTML document [closed]

一笑奈何 提交于 2019-12-03 08:52:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I like the feature in Visual Studio for formatting an HTML document ( CTRL + K , CTRL + D ). Is there a plugin with the same

Resharper C# Formatting Style shows “new” on new line instead of same line when chopping long lines

ぃ、小莉子 提交于 2019-12-03 07:01:53
So Resharper is putting a line break before the "new" in my code when re-formatting it as follows: var foo = new Foo { Bar = null, Baz = new Baz { Bap = null, Bork = null, Help = new PweaseHelp { Korben = null, Dallas = null, Multipass = null }, Me = new ClearlyMyAbilityToUnderstandResharperSettingsIs( null), } }; But I'd really like it too do this: var foo = new Foo { Bar = null, Baz = new Baz { Bap = null, Bork = null, Help = new PweaseHelp { Korben = null, Dallas = null, Multipass = null }, Me = new ClearlyMyAbilityToUnderstandResharperSettingsIs(null), } }; I've delved though all the

Eclipse Javascript formatter (ctrl-shift-f)

时间秒杀一切 提交于 2019-12-03 06:42:33
问题 I don't like asking this question but I have honestly been looking for a way to figure this out for a very long time. This is a simple question. I have been using NetBeans for a long time, but recently made the switch to Eclipse for a few reasons I won't get into. Anyway, I find the javascript source formatting behavior to be very odd. Here is an example block of javascript code that I formatted myself: function buildDatabase () { db.transaction(function (tx) { tx.executeSql('DROP TABLE IF

Eclipse formatter adds space in empty comment lines

久未见 提交于 2019-12-03 06:30:17
问题 The eclipse code formatter adds a trailing space in each empty Javadoc comment line (see screenshot). The formatter of a colleague is always removing those spaces (and thus producing annoying SVN diffs). He is claiming to use the same formatter settings (XML file). Nevertheless, I tried all the options in the comments tab of the formatter settings page - without success. Can it be a difference between eclipse versions? (I am using Springsource Tool Suite 2.7.1, which is based on Helios, I

How to replace all tab characters in a file by sequences of white-spaces in intellij?

社会主义新天地 提交于 2019-12-03 04:54:19
问题 Given a file in my project, I want to be able to replace all of the tab characters in the file with white spaces. Is there any way to do this in intellij? 回答1: Go to Edit | Convert Indents , and then choose To Spaces or To Tabs respectively. It's in the documentation: Changing identation 回答2: Replace only tabs used for indentation Ctrl + Shift + A type "To Spaces" > Enter Replace all tabs Ctrl + R check Regex Enter \t and spaces Replace all 来源: https://stackoverflow.com/questions/25816516/how

Set Visual Studio Formatting Options for an entire team

ε祈祈猫儿з 提交于 2019-12-03 04:31:18
Different devs on our team have wildly different checkboxes here: and as a consequence Visual Studio keeps reformatting code and this really pollutes our commits. What I want is to have a single whatever ( .reg file or something) to run on each devs' computer so that these settings will be consistent. How can I do this? With VS2017, .editorconfig files are taken into account and allow to override local preferences. Put it at the root of your projects solution (or even higher), under source control in order to distribute it with your sources to each developer. You can set .Net coding

Emacs Ruby method parameter indentation

删除回忆录丶 提交于 2019-12-03 04:26:28
I want to make emacs indent ruby method calls like: foo( :blah => 'bar', :shibby => 'baz' ) The closest I can get is: foo( :blah => 'bar', :shibby => 'baz' ) This is using ruby-deep-indent-paren, ruby-deep-indent-paren-style, ruby-deep-arglist all set to nil. Hashes indent how I like... if I could just make method calls indent like hashes I would be happy. Any ideas? Luke Girvin Dmitry Gutov has posted this fix , using advice, which seems to work: (defadvice ruby-indent-line (after unindent-closing-paren activate) (let ((column (current-column)) indent offset) (save-excursion (back-to

Is it possible to prettify scala templates using play framework 2?

空扰寡人 提交于 2019-12-03 04:22:49
问题 Using Play Framework 2 I've noticed the rendered Scala HTML templates don't like indented @if or @for . So, for example, something like that: <ul> @for(test <- tests) { <li>@test.name</li> } </ul> Will have extra unneeded spaces. To fix it, I need to do something like that: <ul> @for(test <- tests) { <li>@test.name</li> } </ul> Which will get messy with additional @defining or other statements. So, is there a way to prettify/beautify Scala templates rendering in order to get rid of extra

Declaring a looooong single line string in C#

北城余情 提交于 2019-12-03 04:17:44
Is there a decent way to declare a long single line string in C#, such that it isn't impossible to declare and/or view the string in an editor? The options I'm aware of are: 1: Let it run. This is bad because because your string trails way off to the right of the screen, making a developer reading the message have to annoying scroll and read. string s = "this is my really long string. this is my really long string. this is my really long string. this is my really long string. this is my really long string. this is my really long string. this is my really long string. this is my really long

Matlab code formatting similar to AStyle? [closed]

怎甘沉沦 提交于 2019-12-03 03:20:26
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Is there any tool similar to AStyle to format matlab code in m-files? In recent versions of MATLAB, you can use the "Smart Indent" tool programmatically using the MATLAB Editor API . As an example, say you want to fix indentation of all M-files contained in