9.0 "remove unused directives" feature is moving declarations out of namespace

I use the "remove unused directives" feature a lot to clean up redundant using statements. The behaviour has changed from 8.x to 9.0 though.

Take the following example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;

namespace e25London.Web.Areas.Members.Models.Event
    using e25London.Domain.Models;

    public class EventManager

Line 1 shows up as a redundant reference. If I alt+enter on this line, it removes all unused references which is fine. However, it also moves the line "using e25London.Domain.Models" from inside the namespace to outside of the namespace. It ends up in the using statements at the top, but this is not desirable.

Is this a bug, or am I able to tell ReSharper to leave references where I have declared them them?

1 comment
Comment actions Permalink

Hello Laurence,

  Please set up needed behavior here ReSharper | Options | Code Editing | C# | Code Style | Reference Qualification.



Please sign in to leave a comment.