Seems like copy/paste ate up one of the spaces in the indentation in the actual results that I stated in my original email.

The actual result is supposed to be as follows:
-----
test indentation {
       void func(x:int, y:int,
       s:javalangString,
       foo:javasqlDate,
       blupp:mylongtype,
       msads:adshdjkhsakdasdkslajdlsask,
       x:x, a:b, c:d);
       }
-----

So, the line " void func(x:int, y:int," exceeds the max line width of 30 and should have been wrapped (before y:int).

Mary

--------------------------------------------------
From: "Mary Komor" <[email protected]>
Sent: Friday, May 27, 2011 1:52 AM
To: "Xtext dev list" <[email protected]>
Subject: How are tabs counted in the length of a line?

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
[email protected]
https://dev.eclipse.org/mailman/listinfo/xtext-dev

Reply via email to