Roslyn: 'Inline rename' adds an extra Attribute string when renaming an attribute

Created on 22 Aug 2017  路  25Comments  路  Source: dotnet/roslyn

Version Used: VS2017 15.3.1

Steps to Reproduce:

Inline rename the attribute below from MyAttribute to eg. XXXAttribute

C# sealed class MyAttribute : Attribute { }

Expected Behavior:

New name is XXXAttribute

Actual Behavior:

New name is XXXAttributeAttribute

Area-IDE Bug Developer Community Resolution-Fixed

Most helpful comment

Issue is still present in 15.7.0 Preview 3.0 [27602.0.d15.7]

All 25 comments

Yes, I've encountered this problem too.

Having recently updated to 15.3.1, I'm now seeing the same problem. A workaround is to comment out the base class declaration, rename, and then uncomment the base class declaration.

Issue is still present in 15.7.0 Preview 3.0 [27602.0.d15.7]

I've encountered this problem in version: 15.7.3

Workaround:

  1. Temporarily comment out inherited Attribute class, so you'll get e.g.
    public sealed class MyAttribute // : Attribute
  2. Perform the inline rename
  3. Remove the comment so your class inherits Attribute again
    public sealed class MyRenamedAttribute : Attribute

Well better workaround would be to first rename the class and then update references using the light bulb.

Guys, are you going to fix it? A year has passed already.

Guys, are you going to fix it? A

@yaroslavboev Are you interesting in contributing a fix? I can help walk you through the areas to look at here to fix this.

A year has passed already.

Time is generally only a small factor in prioritization of issues. In this case, the issue likely being out-prioritized by other work. If you'd like to help contribute here, that would help move things along! :)

@CyrusNajmabadi I would like to try to fix this issue

@lillo42 Great! Have you contributed to Roslyn before? Do you have an existing enlistmnet to work out of? Or would you need to get that set up?

@CyrusNajmabadi I haven't contributed before, I would like to get that set up. Do you recommend some article or something to read before I begin to fix?

@lillo42

Here is a basic overview of roslyn to get you started.

Here are instructions on how to build and debug roslyn.

Here is where the inline rename code lives.

You can always ask questions on gitter, team members try to monitor that.

@jmarolf Thanks much. I was just writing this up. You helped me out a lot finding all these references :)

@jmarolf @CyrusNajmabadi Thank very much.

also reported here

@OndrejVrsan Your workaround works thanks, issue still not resolved.

This issue still exists (at least in the version of Roslyn used by VS Community 2017 15.8.6)

@SaSiNO97 The fix will be available in VS 2019 Preview 2 (16.0 is the numeric version of VS 2019, just like 15.0 is for 2017), not in 15.8 or 15.9 unfortunately.

Why will this issue not be fixed in 15.9?

@PCC-UK Sadly, no.

@Neme12 There was a "Why" at the start of @PCC-UK's question :)

This is still an issue, why is this still not fixed?

@SieBrum

This is still an issue, why is this still not fixed?

Works for me:

image

image

image

image

@Neme12 Thanks, I really appreciate the work you are doing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gafter picture gafter  路  279Comments

Pilchie picture Pilchie  路  113Comments

MadsTorgersen picture MadsTorgersen  路  120Comments

mattwar picture mattwar  路  190Comments

MadsTorgersen picture MadsTorgersen  路  463Comments