zls icon indicating copy to clipboard operation
zls copied to clipboard

Add snippet completion configuration options

Open wilsonk opened this issue 4 years ago • 3 comments

const std = @import("std");
const panic = std.debug.pan    <<-- TAB

After you TAB to complete that import in the newest vscode, zls completes and fills in the parameter signatures for the panic function. However, if you just wanted to complete to 'std.debug.panic;' by trying to hit ';' after the TAB (which is the default in some other languages), then the parameter signatures don't self delete properly.

Not sure if that is the correct behavior here but thought I would mention it.

wilsonk avatar May 18 '20 11:05 wilsonk

Title changed as per suggestion from @alexnask after discussing this. I was using a third party completion tool called Tabnine that was giving me different options for TAB completions. This situation doesn't seem to be solvable the way I mentioned above, but Alex may have a different solution.

wilsonk avatar May 18 '20 23:05 wilsonk

We could add options like inserting a tab stop before the parentheses, which may be useful to some people to have the option to delete argument lists more quickly when they don't need them.
Another option could be choice completion of enum literals for enum arguments.
We can do so some interesting stuff with snippet completions.

alexnask avatar May 18 '20 23:05 alexnask

Options for different types of behavior like this are usually appreciated by the end users...in my experience, at least. It would be a nice addition when you get the chance. Thanks

wilsonk avatar May 18 '20 23:05 wilsonk

If I understand the issue description correctly then this has become configurable through enable_argument_placeholders option. Solved almost 4 years later. 🫡

Techatrix avatar Feb 28 '24 15:02 Techatrix