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:
- « with
ALT
holding down and then1
7
4
on the num block - » with
ALT
holding down and then1
7
5
on the num block - or you map a good key combination to the two chars in your IDE, e.g.
CTRL
+<
andCTRL
+>
© 2022 - 2024 — McMap. All rights reserved.