Summary: | Smoke 20020423: replace from local history wrong indentation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | UI | Assignee: | Dirk Baeumer <dirk_baeumer> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P1 | CC: | andre_weinand |
Version: | 2.0 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Dirk Baeumer
2002-04-23 12:38:43 EDT
The problem has nothing to do with the change in MemberEdit. It is as follows: the method runTest contains lines with no indentation. As a result the method removeIndentation doesn't remove any indentation. Thus we end up having two indentations. To fix the problem the method that computes the indent of a code block must deal with empty lines and lines that only contain a new line. The suggested fix is problematic since the member edit and the code formatter util don't know anything about line delimiters. The member edit API takes an array of lines and the initial assumption was that the lines don't contain line delimiters (but it isn't doced). There are helper methods on Strings and TextBuffer to convert a string or a range into an array of lines. IMO we should fix as follows: - MemberEdit assumes that the passed array of lines don't contain line delimiters. We doc that in the constructor - CodeFormatterUtil treats empty lines correctly. Andre what do you think ? Can you pass an array of line which don't contain line delimiters Fixed in build > I20020423 |