Conversation

This Tweet is from a suspended account. Learn more
Yeah, that's what I do - feels a bit hacky though, and can't really put them in patterns. Also can't use them interactively for case splitting etc. like in Agda, Idris, Haskell, etc.
1
1
One example is function completion, where it inserts a function call with argument names pulled from the parameters (which may not exist in scope). It would be super nice if it inserted a function call with a bunch of holes that you could jump to and fill interactively… 😅
2
I personally disable this feature (`"rust-analyzer.completion.addCallArgumentSnippets": false`), as find it more distracting than useful. Parameter info popup and completion, if done right, should work just as good as holes. Sadly, param info in code is
1
1
Replying to and
I mean, the proposal still seems like an improvement, but it would be neat to see more support for manipulating unfinished code. `todo!()` works sometimes, but it's limited in where it can be used, and can't be manipulated and jumped to in the editor.
2
1
Oh, not to mention, it's also super handy to have a list of holes with their types that you can use to keep track of what you need to finish! That's one of the things I don't get from `todo!()`.
1
Replying to
Sure, the code is broken, but I don't think that by itself this means worse UX. If the ide highlights the error, provides type-driven completions for arguments, and shows popup with expected parameter types/names/docs, then I think the UX would be as nice.
1
1
I guess I think it'd be really nice to be able to run the incomplete code, providing warnings at edit/compile time, and then panicking if the incomplete code is encountered at runtime. That way you can leave code incomplete, then come back to it later more smoothly.
1
Show replies
Replying to
>Same goes for `match`, where this stuff becomes even more useful! For match actually, I feel like `_` can play a syntactic role of a hole? "Split _" 💡is totally doable (but is not implemented yet).
1
Show replies