question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Signature help for delegate types

See original GitHub issue

If you’re looking at this, ready to type a lambda, how do you know what to type next?

image

If it’s Func<...> or Action<...> it’s easy. For two or three others, I have the signature memorized and can translate the generic types in my head to the appropriate locations (e.g. Predicate<X>). For 99% of delegate types, it’s a bunch of F12ing or F1ing every time.

Could signature help show something like this?

ParseArgument<SemanticVersion> is (ArgumentResult result) => SemanticVersion

@CyrusNajmabadi mentioned that something similar is already shown for anonymous types: image

🔗 Also reported at AB#1244148

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:42 (39 by maintainers)

github_iconTop GitHub Comments

3reactions
TahirAhmadovcommented, Jan 2, 2023

Hi all, would it be feasible to auto-insert the whole signature with the “press tab” feature? When you have:

delegate void FooDelegate(string name, int age);
void Bar(FooDelegate foo) { ... }
// you type:
Bar(
// and we get this offered for "press tab" auto-complete:
Bar((name, age) => { }
2reactions
CyrusNajmabadicommented, Oct 9, 2020

@jnm2 Consider this a green light. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - What is the purpose of a delegate type variable?
A delegate must have a specific signature so that calls and assignments to the delegate variable can be type-checked. There are two ways...
Read more >
C# Delegates
Delegate is the reference type data type that defines the signature. Delegate type variable can refer to any method with the same signature...
Read more >
How to manage different delegate signatures/Types ...
My aim is to create garbage-free Delegate Manager with support for any number of delegate signatures/types.
Read more >
C# Delegates and method signatures
Any method that matches the delegate's signature, which consists of the return type and parameters, can be assigned to the delegate.
Read more >
Delegates - C# Programming Guide
When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found