Snippets not triggering in comments


#1

I’ve created some custom snippets for use in javadoc comment blocks & documentation, however I can’t get them to show up when I’m in a comment block. If I set the scope to .source.java, it works fine of course, as long as it is outside of the the comment block.

I’m just wondering, is there a separate scope for javadoc comment blocks that I’m not aware of? Or am I just out of luck getting this to work without getting over involved in some kind of coding crusade?


#2

Put your cursor in the comment block and press Alt+Cmd+L on OS X or Ctrl+Alt+Shift+L on other platforms. This will bring up the list of scopes that apply to that point in the code. I would be very surprised if .source.java did not apply to that point in the code.


#3

awesome! Except Ctrl+Alt+Shift+L creates a diagnostic log for my track-pad on my laptop… Guess I need to reassign that key command.

Also, like I said, it works fine outside of the comment block when the snippet scope is set to .source.java, but the snippet is suddenly unavailable in the comment block.

EDIT: source.java, meta.class.java, meta.class.body.java, comment.block.java are all of the scopes at the cursor inside a comment block in a .java source file. Even with all of these added, it still does not work.

RESOLVED: Turns out to have been a conflict issue with the prefix I was using. Changing the prefix fixed the issue. Thanks for pointing out that keybinding! That ought to be a big help in the future.