Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-pmc] Add new API constants org.eclipse.jdt.core.formatter.CodeFormatter.F_INCLUDE_COMMENTS


+1 for flag addition during 3.4M7.



Frederic Fusier/France/IBM@IBMFR
Sent by: eclipse-pmc-bounces@xxxxxxxxxxx

04/14/2008 07:08 PM

Please respond to
eclipse-pmc@xxxxxxxxxxx

To
eclipse-pmc@xxxxxxxxxxx
cc
Subject
[eclipse-pmc] Add new API constants        org.eclipse.jdt.core.formatter.CodeFormatter.F_INCLUDE_COMMENTS






GOALS/BENEFITS:
- Add a new formatter flag to request comment formatting in one pass.
 Some context:
   The current formatter does not include comments while formatting
   a compilation unit. As a consequence, for clients using this API
   (like JDT/Text), the complete formatting of a compilation unit
   code and comments currently involves multiple passes where the
formatter
   is called again for each individual block of comments.
   This not only makes it hard for clients of this API to understand
what's the
   expected behavior should be, but it is also completely inefficient on
the
   performance side.
   With the planned work, entire unit will be formatted in just one pass
   (code + comment). This feature will also be accessible to the
command-line
   formatter which up until now is unable to process comments.

- The flag API addition is intended to improve the backward compatibility
of
 the enhanced formatter.

AFFECTED BUGS:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=102780

RISKS:
- If we did not add a new flag, then we would have to retrofit the new
comment
 formatting behavior in some existing formatting mode. Though feasible,
this could
 impact some clients in non trivial ways.

- The new feature and new API has a large number of regression tests:
 -> we have added more than 200 tests on JDT/Core formatter tests
 -> comparison with current formatter on JUnit 3.8.2 sources
 -> format all units of a Ganymede M5 full source workspace (around
26,000)
    without any serious issues or loss of information

PERFORMANCE IMPACTS:
- Great performance improvements can be expected: to format a compilation
unit,
 only a single (instead of two) pass will be necessary.

Cordialement/Regards,

Frédéric


_______________________________________________
eclipse-pmc mailing list
eclipse-pmc@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipse-pmc



Sauf indication contraire ci-dessus:/ Unless stated otherwise above:
Compagnie IBM France
Siège Social : Tour Descartes, 2, avenue Gambetta, La Défense 5, 92400 Courbevoie
RCS Nanterre 552 118 465
Forme Sociale : S.A.S.
Capital Social : 542.737.118 €
SIREN/SIRET : 552 118 465 02430


Back to the top