Community
Participate
Working Groups
3.8. Add token location for constructor start (CompletionContext.TL_CONSTRUCTOR_START).
Created attachment 219203 [details] proposed fix v1.0 + regression tests Dani, let me know if this patch suffices. The TL_CONSTRUCTOR_START will be set for all of new |, new M| or new Ma| in the case below. class Main { void foo() { new | } }
(In reply to comment #1) > Created attachment 219203 [details] [diff] > proposed fix v1.0 + regression tests > > Dani, let me know if this patch suffices. The TL_CONSTRUCTOR_START will be > set for all of new |, new M| or new Ma| in the case below. > > class Main { > void foo() { > new | > } > } Yes, if the space between "new" and | stands for any number of whitespace.
(In reply to comment #2) > Yes, if the space between "new" and | stands for any number of whitespace. Yup. Released via commit cfc5eb85d262e7fc676968dac1dbb5e48659f078 and also added a new test to confirm that any number of whitespaces work between new and |
Thanks. Using new API now in jdt.ui (master) and verified that it works.
The javadoc reads for the new completion context reads "The completed token is the first token of a constructor." it is better worded as "The completed token is the first token of a constructor invocation expression". Verified for 4.3 M1 using Build id: I20120805-2000
(In reply to comment #5) > [..] > "The completed token is the first token of a constructor." it is better > worded > as "The completed token is the first token of a constructor invocation > expression". Good point. Fixed via commit 5b4b5a81d63f2a4115a13f4d0d483f456163707a