Is it possible to write comments inside an Xtend template? (for example in order to quickly comment out an IF-statement or anything)
Yes, that's possible. Use the toggle-comment action in Eclipse or type the prefix «««
manually, e.g as in ««« my comment in a template
You can use «««
for single line comments like Sebastian Zarnekow mentioned.
A drawback of this commenting style is that it also comments out the newline character at the end of this line. Sometimes that's exactly what you want, but sometimes it's not.
For example: The following code snippet ...
val x = '''
line 1
line 2 ««« my comment
line 3
line 4
'''
println(x)
... will print following output ...
line 1
line 2 line 3
line 4
Another way to comment is as if you would insert an expression and inside the expression («») you use a plain old java comment. : «/* comment */»
That way you can go on with you template in the same line, span multiple rows and you avoid the deleted newline character.
PS: You can insert the guillemets this way:
ALT
holding down and then 1
7
4
on the num blockALT
holding down and then 1
7
5
on the num blockCTRL
+<
and CTRL
+>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With