Making commenting easier

Describe your feature request
In Visual Studio Code (and pretty much any other IDE I’ve used, and I’ve used a lot) there is a way to start a comment and have the IDE finish it up. So, for instance, if I were to write /** and press enter, then I would see */ appear, and each time I’d press enter a new * would appear, with */ appearing at the very end. That doesn’t happen in a Java replit.

By the same token, in other IDEs I can write a comment adjacent to a method, and it figures out, based on the return type and parameter list, the skeleton of a JavaDoc comment.

What problem(s) would this feature solve?
The pain of having to set up comments. My students are already reluctant to write comments, and these extra steps do not help.

Explain what you were trying to do when you came across the problem leading to this feature request

Trying to write a comment.

Replit Profile: https://replit.com/@mprogers

1 Like

To comment on Replit, just use Ctrl / on any programming language. In languages like HTML and CSS where comments can be multiline or in the middle of a line, highlight the part of the code you wish to make a comment and then use Ctrl / (if you wanted to remove a feature without deleting the code). This is similar to what you’re describing. In my experience, I thought that HTML and CSS repls did this. Maybe it’s just a Java thing.

Other useful Replit keyboard shortcuts
  • Ctrl [ | Unindent code
  • Ctrl ] | Indent code
  • Tab | Indent code
  • Shift Tab | Unindent code
  • Ctrl S | Autoformats code
  • Ctrl Enter | Runs code
6 Likes

Thanks, CoderElijah, that’s useful. I’m still hoping for JavaDoc comments, and if nothing else the ability to create multiline comment blocks, like these, with just one click / command:

  /** 
   * @param data
   * @return int[]
   */
  public int [] summingRows(int[][] data) {
5 Likes