dotnet / dotnet/roslyn

Autocompletion of method overrides places method above attribute

Open
#80,913 0 comments 0 reactions 1 assignee Claimed by @akhera99 View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**: VS 18.0.0 Insiders [11121.172]

**Steps to Reproduce**:
Invoke auto-complete at the marked location.
```csharp
class TestAttribute : Attribute;

abstract class B
{
public abstract void M();
}

class C : B
{
[Test]
override M$$
}
```

**Expected Behavior**:
The existing attribute that is located before the stub override is applied to the generated method body (i.e. the method is placed after the attribute that precedes it).

```csharp
class C : B
{
[Test]
public override void M()
{
throw new NotImplementedException();
}
}
```

**Actual Behavior**:
The method declaration is placed above the attribute. This is easily fixable by hand, but it is annoying.

```csharp
class C : B
{
public override void M()
{
throw new NotImplementedException();
}
[Test]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.