VSCode wrap with function call snippet/shortcut? Or move cursor to beginning of selection?

Hey all trying to wrap a long array of objects in a function call.. I looked at the 'surround' snippet in VSCode but the only function wrapper they have is to actually declare one, not simply call... Any ideas? Id be happy to do it with selections, but you cant move your cursor to the beginning of a selection (only to the beginning of a line). :~(
1 Reply
Jim
Jim16mo ago
sooooo something like:
{
name: 'header',
title: 'Header Text',
type: 'string',
},
{
name: 'logos',
title: 'Logos',
type: 'array',
of: [{ type: 'image' }],
},
{
name: 'border',
title: 'Border',
type: 'boolean',
initialValue: false,
},
{
name: 'header',
title: 'Header Text',
type: 'string',
},
{
name: 'logos',
title: 'Logos',
type: 'array',
of: [{ type: 'image' }],
},
{
name: 'border',
title: 'Border',
type: 'boolean',
initialValue: false,
},
to
defineType({
name: 'header',
title: 'Header Text',
type: 'string',
}),
defineType({
name: 'logos',
title: 'Logos',
type: 'array',
of: [{ type: 'image' }],
}),
defineType({
name: 'border',
title: 'Border',
type: 'boolean',
initialValue: false,
}),
defineType({
name: 'header',
title: 'Header Text',
type: 'string',
}),
defineType({
name: 'logos',
title: 'Logos',
type: 'array',
of: [{ type: 'image' }],
}),
defineType({
name: 'border',
title: 'Border',
type: 'boolean',
initialValue: false,
}),
yes... im upgrading sanityio :~)