|
From: Charles R. <cr...@ri...> - 2002-04-19 13:11:55
|
The "int result" line does appear to be a bug that I thought was fixed,
so we'll have to look into it.
The indenting of the string within the array is simply not handled by
our system-- we're not looking for the "=". Fixing this is another
iteration to the tree, since it will involve additional rules.
As for indenting comments, we discussed that many times and went back
and forth. It was a conscious decision to make it act this way (I think
because of how the rule affects another rule), but it might be possible
to leave commented lines with text and without a leading star alone.
And yes, the whole thing is documented at the package level (see
package.html) in the Javadoc.
Charlie
Peter Centgraf wrote:
> Indent Group:
>
> I think I may have found a bug in the indent decision tree. Take a look
> at this example from DrJava.java:
>
> private static void _setupCompilerIfNeeded() {
> if (CompilerRegistry.ONLY.isNoCompilerAvailable()) {
> // no compiler available; let's try to let the user pick one.
> final String[] text = {
> "DrJava can not find any Java compiler. Would you ",
> "like to configure the location of the compiler? ",
> "The compiler is generally located in 'tools.jar', ",
> "in the 'lib' subdirectory under your JDK ",
> "installation directory. (If you say 'No', DrJava ",
> "will be unable to compile programs.)"
> };
>
> int result = JOptionPane.showConfirmDialog(null,
> text,
> "Compiler not found",
>
> JOptionPane.YES_NO_OPTION);
>
> Notice that the declaration of "result" is indented an extra level, as
> are the non-first elements of the declaration of "text". I'm mildly
> surprised that the closing bracket is matched properly, since it is
> backing up an extra level of indentation. Is the code correctly
> handling this type of array initialization?
>
> Another detail, which I'm not sure is a bug or a feature request: If
> you comment out code with /* */ and then reindent it as part of a block
> selection, all lines are aligned left, losing the original indentation.
> I imagine that this would also destroy any manual ASCII table alignment
> within comments. Is it possible to ignore lines within comments when
> doing a block re-indent? This issue is especially troublesome because
> an indent operation is not easy to undo with the current implementation.
>
> Is there any central documentation (maybe a flow chart) for the decision
> tree as it is currently implemented? I think it would be helpful to be
> able to debug the logic separately from the implementation, since there
> is a significant amount of code to scan.
>
> --
> Peter
>
>
> _______________________________________________
> drjava-hackers mailing list
> drj...@li...
> https://lists.sourceforge.net/lists/listinfo/drjava-hackers
>
> .
>
|