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.
Preprocessor re-comment could be automatic. How it might be done so that it is not a performance issue: 1. Make an option "Automatic preprocessor re-comment" in the editor options so that a user can turn this function off 2. Whenever a user types in the preprocessor part in the code, a timer is set to execute the re-comment action in some 3-5 seconds. This timer is reset whenever a user types a key in the code for preprocessor. After the timer action triggers, the re-commenting is executed on the background.
I'm sorry, but what is 'preprocessor re-comment'? What file types are you talking about? What user action would you like to automate? Please be more specific about how the feature should work from the user's point of view. Thanks
Sorry for the brief description, I will give more elaborate one. If you create a new mobility project (MIDP Application), you can use a preprocessor to build your application on various platforms. For example - if you write: //#if CLDC System.out.print("CLDC present"); class A { // CLDC specific implementation of some class } //#else System.out.print("CLDC not present"); class A { // universal implementation of some class } //#endif the right code is included in the build according to the presence of CLDC platform. Java preprocessor used in NB is based on commenting-out the code. If you have the code above, error badges are usually displayed in the editor, as class A is redefined in the code. However, the build works fine (classes are in different preprocessor blocks), you can build the code above... If you don't like the fact you can see the errors in the editor (while the code is correct), you can invoke a popup menu on the editor and choose "Preprocessor blocks > re-comment". This can result in following code, for example: //#if CLDC System.out.print("CLDC present"); class A { } //#else //# System.out.print("CLDC not present"); //# class A { //# } //#endif In other words, the code that is irrelevant with respect to the current settings is commented out. I think the action from the popup menu mustn't be necessary - you see the errors in the correct code until you ask the editor to hide it - this is not very logical, imho. The code should be "re-commented" automatically, after a user closes a preprocessor block, for example, or after a few seconds after user typed in the preprocessors code... It would be best if the code was not commented out in the editor (it could be physically commented out in the file) but if it was just grayed. I will provide you a how-it-might-look-screenshot from other IDE (which is not for Java, but it is irrelevant)...
Thanks for this nice description. I think it's pretty clear how the feature should look like from users point of view. I'm not sure how much of this can be implemented in mobility editor and how much support they will need from the java infrastructure. But since this feature primarily concerns mobility apps support I'm reassigning it to them. I'm sure they will ask for specific support from java infra if they need some.
... just a note... the "System.out.println" should not have been in the sample code, of course (this code does not make sense)...
See also enhancement proposal here: http://qa.netbeans.org/issues/show_bug.cgi?id=83096 This is a screenshot/footage I made to demonstrate how nicely it could look:o): http://www.netbeans.org/nonav/issues/showattachment.cgi/61048/before_and_after.png