This changeset adds snippet support to function or method completion items so that an editor will insert tab stops for parameters. I need to go back through the spec to ensure I haven't missed anything, but I wanted to open it up so others could take a look and so far for my uses it works well.
Changes
Added insertTextFormat to completion items, using Plain for all items except functions and methods, which use Snippet
Modified the insertText for function/method items to insert parens and use tab stops for each parameter. For example, given the initial text math.fm, completing the item described as math.fmod(x, y) inserts math.fmod(${1:x}, ${2:y}) instead of math.fmod.
Coverage increased (+0.1%) to 80.164% when pulling 74d593dad3fae55b07bc1a8ae3a3034bcc422a87 on kattrali:kattrali/insert-fns-as-snippets into 905e71f9a97ea6366deb386503f9d976c87d9bab on Alloyed:master.
This changeset adds snippet support to function or method completion items so that an editor will insert tab stops for parameters. I need to go back through the spec to ensure I haven't missed anything, but I wanted to open it up so others could take a look and so far for my uses it works well.
Changes
insertTextFormat
to completion items, usingPlain
for all items except functions and methods, which useSnippet
insertText
for function/method items to insert parens and use tab stops for each parameter. For example, given the initial textmath.fm
, completing the item described asmath.fmod(x, y)
insertsmath.fmod(${1:x}, ${2:y})
instead ofmath.fmod
.Screenshots
Before:
After: