sway icon indicating copy to clipboard operation
sway copied to clipboard

Add support for snippets in the language server.

Open JoshuaBatty opened this issue 3 years ago • 0 comments

Users should be able to run custom commands for generating and adding various code snippets.

@Braqzen had a good idea on Slack that i'm posting below. Would be great to get any more ideas for other handy snippets if people have them.

From Slack:

A way to auto template doc comments on functions. You could specify a file or a function and it would create a basic template which includes your function args so that there's less to do e.g. it could look something like.

/// Function summary here
///
/// # Arguments
///
/// * `parameter name 1` - 
/// * `parameter name 2` -
///
/// # Returns
///
/// * `SomeStruct` - 
/// * `bool` - 
/// * `bool` -

There wouldn't actually be a summary but there would be some placeholder instead. Also, if it returns anything then it would specify that too in the same order, similar to the params.

JoshuaBatty avatar Aug 11 '22 00:08 JoshuaBatty