csharp-language-server
csharp-language-server copied to clipboard
AutoCompletion of Attribute-types includes `Attribute` suffix when not needed/required
Consider the following code:
[Route("Demo")]
public class DemoController : Controller
{
[HttpGet]
[Router("DemoOperation")]
public IActionResult DemoOperation()
{
// some logic
}
}
Now try chaning the [HttpGet] attribute into a [HttpPost] attribute, by deleting Get, entering P and wait for auto-completion to kick in.
Observed that:
HttpPostis not suggestedHttpPostAttributeis suggested- It is harder to write
[HttpPost]than without auto-completion. Oops?
Basically, unless you are willing to live with the needlessly verbose attribute-name, auto-completion now kinda works against you.
Since attribute-completion is somewhat context-sensitive, I'm not sure if there are any simple solutions here... But if there is, that would really be appreciated :smile:
Yeah.. I will need to check how omnisharp does that and will steal the code :)
does it do the same for [Flags] ? because I tried adding a [Flags] on enum and it worked..
probably your issue is with classes, right?
Yeah. I’ve tested with basic classes and not with enum-flags yet.
Old issue is old. Not sure if it's still even an issue. Abandoning.