Using VSCode snippets, I would like to have the following behaviour. Say I select the word “foobarbaz”, then (using a snippet) I would like it to turn into
/******************************************************************************/
/* foobarbaz */
/******************************************************************************/
where the length of the comment block is fixed. This means that the number of spaces before and after “foobarbaz” depends on the length of “foobarbaz” itself. The idea is that the number of spaces on the left and on the right of the selected word is the same. In the cases where the length of the word is an odd number, I would have the left number of spaces to be one less than the right number of spaces.
Would it be possible to have this behviour implemented with VSCode snippets, or is it too complex?