简体   繁体   中英

How to comment out a line in an Android Studio (IntelliJ?) file template?

Under Preferences > Editor > File and Code Templates > Files > Class there is this following line by default:

#parse("File Header.java")

I want the line to remain there in the template file but I want to comment it out so that it doesn't parse. At the bottom of the description of this page of the preferences, it says the Apache Velocity template language is used.

To add a comment in Velocity , you use ## . However, when I modify the template file like so:

## parse("File Header.java")

The ## are just underlined in squiggly red. Does Android Studio (and I'm guessing this is the case with IntelliJ but I haven't tried) not support the full functionality of the Apache Velocity template language?

## ...

is the correct way to comment a line using the Velocity syntax.

The fact that the syntax highlighter of the editor doesn't recognize it doesn't mean that it won't work. Did you try, at least?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM