code-formatting

Java API for source formatting

Hi There are several PHP or js code formatting libs out there -- does anyone know if similar libs exist in Java? Ie., Given a string of code, return a formatted string with syntax colouring etc. It'd be ideal if it auto detected the language, but I might be pushing my luck there... The text will ultimately be displayed within a Flex ...

How to create an Intellij and Eclipse compatible code style and code formatting configuration (for java code)?

Few weeks ago I tried Intellij and I found it really awesome. Now, at my project there's two programmers (including me) using Intellij and few other programmers gonna still be using Eclipse. Since this project is already very large and it gonna be growing a lot, we need to use compatible Code Style and Code Formatting between Intellij an...

Visual studio formatting issue

I am using Visual Studio 2008. In my editor whenever I write an automatic property it's "get" and "set" wraps to a single line whenever I wrote "set" and put semicolon(;). like this: public string MyProperty { get; set; } I want it to be formatted like this public string MyProperty { get; set; } Currently I am manually ...

Remove unwanted lines,dead code from source code?

How to make source code free of the following Remove dead codes that are more than few lines between /* c++ codes */ Change more than one line breaks to one Remove modified user name and date /*-------- MODIFICATION DONE by xyz on ------------*/ I have used a code formatter tool to get a nice formatted code but stuck with code with a...

PHP beautifiers (libraries for formatting code)

Previously, my intention was to ask: Do you know any open source SQL formatter/beautifier library for PHP projects? But I think, I'd better ask: Which code formatting libraries written in PHP are the best? Let's list them all in one place. My types: for CSS syntax: Css Tidy for PHP: PEAR's PHP_Beautifier for HTML syntax: Tidy E...

editing the NetBeans source formatting standard

Is there any way of changing the standard by which NetBeans automatically formats the code when doing "Source->Format"? I seem to remember seeing this option somewhere, but I can't find anything about it. ...

How to fix broken automatic indentation in vim

Hi, I am trying to use vim 7.2 (on Windows XP) to automatically indent and format some VHDL and Matlab code. To do so I am trying to use the "gg=G" command. However this does not work properly. The code is not properly indented at all. To give you an example, I had the following source code, which was already properly indented: % This...

PHP and writing clean code

Hello Im trying to find best practices to write PHP. I just wonder is this a bad habit. For example, processing variables. $var = 1 $var = doSomething($var); $var = doSomething2($var); $var = doSomething3($var); It looks a bit awful. Here is a example of a real code that I just did: $this->rSum = explode(",", $this->options["rSu...

How to align C++ class member names in one column in emacs ?

I would like to align all C++ class member names ( do not confuse with member types ) in one column. Lets look at the example of what we have at entrance: class Foo { public: void method1( ); int method2( ); const Bar * method3( ) const; protected: float m_member; }; and this is what we...

Why might my Emacs use spaces instead of tabs?

I am trying to diagnose this problem. TAB creates 4 spaces instead of a 4 col TAB like I want. But I don't think it should because C-h v indent-tabs-mode on the buffer in question says it is set to t. When I check my keybindings, TAB is set to c-indent-line-or-region. Does this function ignore my tabs-mode? ...

Autoformat pom.xml without using m2eclipse plugin

I don't use the Eclipse maven plugin while developing in Eclipse. I generate my Eclipse classpath externally using the following command: mvn eclipse:eclipse This has worked fine for quite some time and I am not inclined to add a maven plugin. However, I would like to be able to "autoformat" my pom.xml file. My pom.xml is not showi...

Any templates for MS Word for formatting source code (when writing psuedocode)?

I'm writing an interface spec in MS Word and it would be great if there were some sort of template or pluggin for Word (2003 here) that would make it all look a bit prettier. (I'm realizing how spoiled I am with even the archaic VB6 IDE). ...

NetBeans Java code formatter: logical operators on new line

My code looks like this: if (firstCondition() && secondCondition()) { // ... code } The default settings for the code formatter in NetBeans wants to put the && on a new line, like this: if (firstCondition() && secondCondition()) { // ... code } The formatter works well so I would just like to find the settin...

Is it possible to color-code and format an XML document using XSLT?

Has this ever been done before? Is it possible to write an XSLT that will turn an XML document into color-coded, formatted, HTML? ...

SQL code editor with syntax highlighing, auto-formatting and code folding

Hello, Is there any SQL editor that supports syntax highlighting, automatic code formatting and code folding? I found this, but it's an Eclipse plugin (I'm a NetBeans user), and cannot automatically format code, which is the most important feature I'm after. Autocompletion is not important, nor is the possibility of running the code (l...

How do you indent preprocessor statements?

When there are many preprocessor statements and many #ifdef cascades, it's hard to get an overview since normally they are not indented. e.g. #ifdef __WIN32__ #include <pansen_win32> #else #include <..> #ifdef SOMEOTHER stmts #endif maybe stmts #endif When I consider also indenting those preprocessor statements, I fear of getting conf...

Is it possible to disable Resharper reformatting of a section of a file?

Possible Duplicate: Is there a way to keep ReSharper from formatting a region of code When I want to test parsing logic on data that would usually be read in from a file or an HTTP call, etc, I usually turn that data into a string in the test. A (short) example is as follows: Line 1 Line 2 Line3 Line 4 Would become: ...

Auto-formatting tool for VBscript

I'm looking for a light, free tool to format my Vbscript code. The only way I've found so far is to auto-format it in VisualStudio. Although, it's too much to launch VisualStudio for this purpose. Is there any web app or a free light tool for this purpose? Maybe a plugin for Notepad++? ...

Formating Contents in RSS

Hi, I'm making a RSS 2.0 feed powered by PHP & MySQL. I would like to know how to make simple formatting in the contents like Line Breaks, Bold, Italics, Links, Images. When I try to insert a <br> in the database for a newline, the feed reader is displaying it as Invalid Feed. Please help Thanks ...

Why not put all braces inline in C++, C#, Java, javascript, etc.?

Of all the conventions out there for positioning braces in C++, C#, Java, etc., I don't think I've ever seen anyone try to propose something like this: public void SomeMethod(int someInput, string someOtherInput) { if (someInput > 5) { var addedNumber = someInput + 5; var subtractedNumber = someInput - 5; } else ...