Skip to content

Code Fixes/refactorings should add using statements if necessary and possible #35806

@YairHalberstadt

Description

@YairHalberstadt

For example, when pull members up to base class is used, and the base class is in a separate document without a suitable using statement, the following happens:

interface Interface
{
    public System.Threading.Tasks.Task PulledUp(System.Guid guid);
}

Instead I think it would be best if pull members up tried to preserve the names as they appeared in the original document. This means that it should add using statements if doing so will not cause conflicts.

Thus it should result in:

using System;
using System.Threading.Tasks;

interface Interface
{
    public Task PulledUp(Guid guid);
}

Similiar applies to Implement members, generate variable, etc.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Complete

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions