Open kuhlenh opened 6 years ago
I have some more concrete info here:
I'd like code snippets to be able to guess expected generic types, similar to e.g. this simple ReSharper live template example that automatically figures out T when emitting a Moq It.IsAny<T>() snippet.
Things to also consider:
.var .foreach
.if .typeof .default .null (null check) .switch .using .ret (return) .assert (Debug.Assert) .block (surround) .cast (direct cast) .new .await
.null .notnull .nameof
This will have a huge impact on editing experience though it's low pri, it seems. I use .var
and .foreach
in Rider all the time and it's really helpful.
Can you describe how the particular snippets work? In particular, it may not be enough to just include them, we may need to update the existing snippet infrastructure to support functionality it doesn't currently have
For instance, (expression).var [enter]
is exactly the same as selecting the expression and "introduce local". So yeah I think it's actually more involved than "snippets" feature we have today.
For .var
Rider even ask if you want to replace this one occurrence or all of them.
That said, I think "custom suffix snippets" should be separated out from the others.
@CyrusNajmabadi Do we have the infrastructure required for this? I think we need something like CompletionProvider but with the ability to change the whole Document
Any progress on this?
Filing on behalf of a customer who wants to be able to have postfix templates and custom templates (similar to ReSharper live templates).
Examples:
We have some of these with snippets, but I don't think we have all of them and our customization story isn't great. Also need to make sure we document all of these...