language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Add auto-complete for transition and animate functions

Open navorite opened this issue 1 year ago • 3 comments

This adds auto-completion for all built-in transition and animate functions.

Could be probably improved by auto-importing the functions on completion? Not sure if it's possible.

navorite avatar Jun 07 '23 19:06 navorite

I am leaning toward only having in:, out:, transition: and even use: here. That would also benefit people with custom transition/animation/action. And if we want to have a complete list. We add that in the CompletionProvider. And add auto-import, possibly with typescript API. Without auto-import, it doesn't save many key-stroke, and I'll still have to go back a few characters to trigger completion/code-action. At least for me, it just feels worse. But that would be way harder to implement thought. @dummdidumm What do you think?

jasonlyu123 avatar Jun 15 '23 01:06 jasonlyu123

I agree, we should only have the in: etc prefixes and no specific fully specified names, will probably only get in the way most of the time.

dummdidumm avatar Jun 15 '23 19:06 dummdidumm

Ah. Right. If there is only the directive keyword. We can't rely on dataProvider. vscode-html-language-service would insert ="" after that. We need to do it on our own instead. Like something here https://github.com/sveltejs/language-tools/blob/master/packages/language-server/src/plugins/svelte/features/getCompletions.ts#L59

jasonlyu123 avatar Jun 16 '23 01:06 jasonlyu123