dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.99k stars 4.03k forks source link

Show potential fixes link does not work #27168

Closed jinujoseph closed 1 year ago

jinujoseph commented 6 years ago

Ported from link Affected Branch: [27710.0.d15.8] Affected Build: 15.8.0 Preview 2.0 Affected Product Language:

Steps to reproduce:

  1. Create new Class Library (.NET Framework) project
  2. Add following code to Class:
public Int32[,] Properties { get; set; } 

public void Foo() 

{ 

    var list = new List<string>(); 

    list.Add("dsfds"); 

    var a = DateTime.Now.ToString("MM"); 

} 

public string ToString() 

{ 

    return "test"; 

} 
  1. Hover mouse over ToString()

  2. Click on "Show potential fixes" link or click on light bulb near ToString or press Alt+Enter or Ctrl+.

Expected: context menu with fix variants appeared

Actual: context menu with fix variants is not appeared

Note: click on light bulb on the left side of editor works

You can also install Microsoft.CodeAnalysis.FxCopAnalyzers NuGet package to get more warnings (which also does not work)

Repro Gif

jinujoseph commented 6 years ago

Affected Branch: [27911.0.d15.8] Affected Build: 15.8.0 Preview 5.0 Affected Product Language:

Steps to reproduce:

  1. Create Class Library C# project
  2. Add Class1: public abstract class Class1 { [Obsolete] public abstract void Foo(); }
  3. Add Class2: class Class2 : Class1 { public override void Foo() { throw new NotImplementedException(); } }
  4. Hover mouse over underlined Foo
  5. Click on Show potential fixes

Expected: menu with option "add the Obsolete attribute to method" appears Actual: nothing happens

  1. Place cursor to underlined Foo
  2. Press Alt+Enter or Ctrl+.

Expected: option "add the Obsolete attribute to method" is available Actual: option "add the Obsolete attribute to method" is not available

Repro Gif

v-rodudi commented 6 years ago

JFYI: ticket author @v-rodudi won't be available after 9/4 so please ask repro-related questions before this date if they are.

CyrusNajmabadi commented 1 year ago

Closing out as this works fine for me locally. Likely an old issue long since fixed.