Adding Documentation while typing code

Hey guys,  

I would like to write a small plugin that adds predefined documentation templates as I type the code.

Specifically, I have in mind a plugin right now for GoLand.

It should work similar to this

When I type something like:

var test string

and hit Enter (or any other action I will come up with)

it should automatically add something like this:

// the test var TODO

var test string

 

Could somebody point me in the right direction on how to approach this?

0
1 comment
Avatar
Permanently deleted user

You might not need a plugin for this.  There is already an action in Keymap (File->Settings->Keymap) for "Fix Doc Comment."  It's probably not mapped, but Ctrl-Alt-Slash is relatively intuitive (since Ctrl-Slash and Ctrl-Shift-Slash are already mapped for commenting in th default key map).

Fix Doc Comment will generate a new one, or fix an existing one if the signature has changed.  So, if GoLand has doc comments defined, then you're already in business.  If it doesn't, then simply defining that it is what your plugin should do.

0

Please sign in to leave a comment.