Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

{/* I would be so happy to never have to do this again */}


Doesn't every editor have a "comment" hotkey? I can't remember the last time I typed block comment characters in any language. cmd-/ in IntelliJ.


I don't want to make the whole line a comment. I just wanna add a comment where the language don't want me to.


Select the fragment you want to comment out, then hit cmd-/. It doesn't have to be a whole line.


Mine doesn’t work very well in JSX blocks. Partly because I don’t think there is any way to insert a comment inside a JSX tag (to comment out an attribute).


It is possible:

<Button

  // id=“commented-out”

  onClick={doSomething}
/>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: