Bug Report T530499
Visible to All Users

Refactorings - The 'Move Type to Namespace' refactoring incorrectly updates the Implements clause in VB

created 8 years ago (modified 8 years ago)

Given following two type-definitions:

Visual Basic
'File: IInterface.vb Public Interface IInterface Property Prop As String End Interface 'File: Class1.vb Public Class Class1 Implements IInterface Public Property Prop As String Implements IInterface.Prop End Class

When moving IInterface to Namespace "Test", the code for "Class1" looks like that:

Visual Basic
Imports ClassLibrary1.Test Public Class Class1 Implements IInterface Public Property Prop As String Implements Test.IInterface End Class

The implements-statement for the property "Prop" has also been changed - and to a complete sensless statement -, what is wrong.

It seems to me, that the implementation is only half done. I would like to have this as the result:

Visual Basic
Public Class Class1 Implements Test.IInterface Public Property Prop As String Implements Test.IInterface.Prop End Class

The Namespace "ClassLibrary1.Test" should not be imported, so conflicts with members of other imported namespaces are avoided:

Visual Basic
' File: IInterface1.vb Namespace Test1 Public Interface IInterface Property Prop As String End Interface End Namespace ' File: IInterface2.vb Namespace Test2 Public Interface IInterface Property Prop As String End Interface End Namespace 'File: Class1.vb Public Class Class1 Implements Test1.IInterface, Test2.IInterface Public Property Prop1 As String Implements Test1.IInterface.Prop Public Property Prop2 As String Implements Test2.IInterface.Prop End Class
Show previous comments (5)
AE AE
Alex Eg (DevExpress) 8 years ago

    Hi Robert,
    The use of Imports or fully-qualified types is a matter of code styling. I suggest you set the 'Namespace references declaration style' option (CodeRush\Options\Editor\Visual Basic\Programming Style) to 'Use fully qualified type names':
    https://www.screencast.com/t/JUISH3QlQ1

      Hi Alex,
      YESSS! That's what I wanted!

      I didn't realized, that this option exists.

      Thank you!

      AE AE
      Alex Eg (DevExpress) 8 years ago

        You are welcome, Robert!

        Answers approved by DevExpress Support

        created 8 years ago (modified 8 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.