Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roslyn analyzer reports "no quick fixes available", but ctrl+. performs a quick fix #5335

Closed
rhys-vdw opened this issue Aug 10, 2022 · 2 comments · Fixed by #5337
Closed

Comments

@rhys-vdw
Copy link

Issue Description

Analyzer suggests that no quick fix is available, when a quick fix is indeed available.

Steps to Reproduce

public struct Foo {
  public Foo Create() => new Foo();
}

image

Expected Behavior

Should not say that there are no quick fixes.

Actual Behavior

Says that no quickfixes are available, but ctrl+. does show a list of quick fixes that are available.

image

Logs

OmniSharp log

n/a

C# log

n/a

Environment information

VSCode version: 1.70.0
C# Extension: 1.25.0

Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.302 Commit: c857713418

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.302\

global.json file:
Not found

Host:
Version: 6.0.7
Architecture: x64
Commit: 0ec02c8c96

.NET SDKs installed:
5.0.407 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
6.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.24 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Download .NET:
https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info

Visual Studio Code Extensions
Extension Author Version
change-case wmaurer 1.0.0
csharp ms-dotnettools 1.25.0
docomment k--kato 0.1.31
EditorConfig EditorConfig 0.16.4
gitignore codezombiech 0.9.0
gitlens eamodio 12.1.2
keyoti-changeallendoflinesequence vs-publisher-1448185 0.0.3
monokai-charcoal-high-contrast 74th 3.4.0
prettier-vscode esbenp 9.5.0
sort-lines Tyriar 1.9.1
toggle-hidden adrianwilczynski 1.0.2
unity-debug Unity 3.0.2
vim vscodevim 1.23.2
vscode-autohotkey-plus cweijan 2.6.2
vscode-counter uctakeoff 3.0.5
vscode-templates redxam 1.1.0
vscode-unitymeta PTD 0.0.7
wordcount ms-vscode 0.1.0
@rhys-vdw
Copy link
Author

Looks like this was acknowledged in #4988

@333fred
Copy link
Member

333fred commented Aug 10, 2022

Indeed, setting kind: QuickAction in the provider unconditionally causes them to show up. The main issue will be figuring out which fixes should actually be considered a QuickFix, which will need to happen on the omnisharp-roslyn side.

333fred added a commit to 333fred/omnisharp-roslyn that referenced this issue Aug 10, 2022
333fred added a commit to 333fred/vscode-csharp that referenced this issue Aug 11, 2022
333fred added a commit to OmniSharp/omnisharp-roslyn that referenced this issue Aug 11, 2022
* Record whether a CodeAction is a fix or not

Omnisharp-roslyn side of fixing dotnet/vscode-csharp#5335.

* Switch to using strings for code action kinds, instead of a bool. Move LSP handler code for this into the main handler, and more accurately classify quickfix actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants