[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [xtext-dev] How are tabs counted in the length of a line?

Hi Mary,

that looks like an enhancement request to me. The line length should use the information about the visual representation of leading tab characters in eclipse.
Could you please file an enhancement request.


Thanks,
Sebastian


On 27.05.2011, at 07:52, Mary Komor wrote:

How are tabs counted when calculating the length of a line (to decide whether it should autoLineWrap or not)? Do they count as 1 or 4 (1 tab = 4 spaces)?

According to FormatterTest.testIndentationAndLineWrap() in the test suite, for the input

-----
"test indentation { void func(x:int,y:int,s:javalangString, foo:javasqlDate, blupp:mylongtype, msads:adshdjkhsakdasdkslajdlsask, x:x, a:b, c:d ); }"
-----


if I use the following config:

-----
c.setAutoLinewrap(30);
// increment the indentation twice after a "{"
c .setIndentationIncrement ().after(f.getTestIndentationAccess().getLeftCurlyBracketKeyword_1());
c .setIndentationIncrement ().after(f.getTestIndentationAccess().getLeftCurlyBracketKeyword_1());
-----


then the actual result is as follows:

-----
test indentation {
      void func(x:int, y:int,
      s:javalangString,
      foo:javasqlDate,
      blupp:mylongtype,
      msads:adshdjkhsakdasdkslajdlsask,
      x:x, a:b, c:d);
      }
-----

But doesn't the line " void func(x:int, y:int," exceed 30 characters? By my count, that line has 31 characters and should have been wrapped. Am I miscounting?

Regards,

Mary

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