This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Some projects have their own rules of formating that should be respected by all developers. Netbeans (especially new Options -> Java rules). But I missing one very importat options: Use tab instead of space for identing. I'm now working or project when all use Eclipce witch can do it, only I'm not be able to use one tab character for identing code. I think that this is very important thing.
I found (thanx to Jiri Prox), that Netbeand can do it. In advanced options -> Editing -> Editor settings -> Java editor is "Tab size" property. When I set it to "4" and unchecked "Expand tab to space" in Basic options -> Editor -> Identation, Netbeans automaticaly use one tab instead of 4 spaces. But I think that this is to complicated for normal user. (based on Netbeans 6 M9)
For example Eclipse has this setting much better. It has select box with Tab policy: - Tabs only - Spaces only - mixed When I selected Tabs only, only Tabs size box is active. All is clearly understandable.
I tested new dev version (20070619) and this problem is again here. This version use new options for indentation (Java Code panel). I set tab size to 4, indentation size to 4, uncheck Expand Tab to Spaces, but Netbeans still use spaces instead of tab. This work correctly before.
This is rather a DEFECT. 'Expand Tab to Spaces' checkbox has no effect, neither inside 'Editor' tab, neither inside 'Java Code' tab. Regression => P2. --- Product Version: NetBeans IDE Dev (Build 070621) Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 System: Linux version 2.6.12-1.1390_FC4smp running on i386; UTF-8; en_US (nb) Userdir: /home/ms159439/.netbeans/dev
Note: In fact doesn't work only "Reformat Code" from context menu. It using spaces instead of Tab.
Note: All autogenerated code use spaces instead of tab (for example try catch, new method, etc.)
The same problem is for JSP identation.
*** Issue 112275 has been marked as a duplicate of this issue. ***
Fixed. Reformat action, code generation, and template expansion should respect 'Expand Tab To Spaces' setting. Checking in java/source/src/org/netbeans/modules/java/source/save/Reformatter.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/Reformatter.java,v <-- Reformatter.java new revision: 1.9; previous revision: 1.8 done Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationModel.java; /cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationModel.java,v <-- IndentationModel.java new revision: 1.11; previous revision: 1.10 done Checking in editor/options/src/org/netbeans/modules/options/indentation/Bundle.properties; /cvs/editor/options/src/org/netbeans/modules/options/indentation/Bundle.properties,v <-- Bundle.properties new revision: 1.10; previous revision: 1.9 done Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.java; /cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.java,v <-- IndentationPanel.java new revision: 1.29; previous revision: 1.28 done Checking in editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.form; /cvs/editor/options/src/org/netbeans/modules/options/indentation/IndentationPanel.form,v <-- IndentationPanel.form new revision: 1.5; previous revision: 1.4 done Checking in java/source/nbproject/project.xml; /cvs/java/source/nbproject/project.xml,v <-- project.xml new revision: 1.24; previous revision: 1.23 done Checking in java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java; /cvs/java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java,v <-- FmtTabsIndents.java new revision: 1.7; previous revision: 1.6 done Checking in java/source/src/org/netbeans/modules/java/ui/Bundle.properties; /cvs/java/source/src/org/netbeans/modules/java/ui/Bundle.properties,v <-- Bundle.properties new revision: 1.10; previous revision: 1.9 done Checking in java/source/src/org/netbeans/modules/java/ui/FmtOptions.java; /cvs/java/source/src/org/netbeans/modules/java/ui/FmtOptions.java,v <-- FmtOptions.java new revision: 1.11; previous revision: 1.10 done Checking in java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form; /cvs/java/source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form,v <-- FmtTabsIndents.form new revision: 1.4; previous revision: 1.3 done Checking in java/source/src/org/netbeans/modules/java/source/pretty/CharBuffer.java; /cvs/java/source/src/org/netbeans/modules/java/source/pretty/CharBuffer.java,v <-- CharBuffer.java new revision: 1.5; previous revision: 1.4 done Checking in java/source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java; /cvs/java/source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java,v <-- VeryPretty.java new revision: 1.54; previous revision: 1.53 done Checking in java/source/src/org/netbeans/api/java/source/CodeStyle.java; /cvs/java/source/src/org/netbeans/api/java/source/CodeStyle.java,v <-- CodeStyle.java new revision: 1.7; previous revision: 1.6 done
This is not fixed with the 20070810 build. During editing (e.g. hitting the enter ENTER key after an opening bracket) the editor still inserts spaces (and not the correct number as well). The Tab key on an empty line will also not honor these settings.
Reassigning to fix the mentioned cases.
Should already be fixed with #112005.
When I use 'Add throws java.lang.Exception tag' to javadoc, NB add this: * @throws java.lang.Exception with two spaces instead of tab space. Try this example: /** * Text * @param a */ public void method(String a) throws Exception { new Exception(); } And also try it in this form: /** * Text */ public void method2() throws Exception { new Exception(); }
Maybe this should go to javadoc module, CCing Honza. The last comment from tprochazka explains what the problem is now.
Honza please take a look.
Unfortunately javadoc hints work around missing or broken comments support of our generator (see issue #90302 and issue #114024). I will try to improve it to reuse the existing indentation.
fixed in /cvs/javadoc/src/org/netbeans/modules/javadoc/hints/JavadocGenerator.java,v <-- JavadocGenerator.java new revision: 1.7; previous revision: 1.6
*** Issue 115838 has been marked as a duplicate of this issue. ***
*** Issue 100381 has been marked as a duplicate of this issue. ***