Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all suggested quick actions

Is there a way to list all the suggested Quick Actions for an open project in VS2017 (v15.3.3)?

I do not see any listed in the Error List window (even with "Build + IntelliSense" selected), though I do see other types of IntelliSense warnings such as CS warnings (e.g. CS1591).

(Quick Actions being the items that are marked in the gutter with a light bulb and accessed with either Alt +Enter or Ctrl+.)

like image 889
Toby Avatar asked Sep 07 '17 10:09

Toby


2 Answers

Thanks to a response from the @VisualStudio twitter account, I've come across this MS Docs page that answers this question: https://docs.microsoft.com/en-us/visualstudio/ide/code-styles-and-quick-actions?utm_source=t.co&utm_medium=referral

It describes how to set code style preferences by opening the Tools > Options window and selecting Text Editor > C# / Basic > Code Style > General.

Here there are a list of the code style preferences. To see where they are suggested in one's own code the severity of each can be changed, say from "None" to "Suggestion" or "Warning". Then, during a build, the locations for the related style will be listed in the Build Output or Errors windows

like image 145
Toby Avatar answered Oct 01 '22 20:10

Toby


This isn't exactly the same as what you're looking for, but could help you make changes much more quickly to the entire document, project, or solution:

When you try to apply a quick action (using Ctrl + .), you'll get a preview of the changes it will make. At the bottom of that preview is a button that says

"Apply to all occurrences in ..."

This will save you from having to go to every single occurrence in a certain scope and fixing it, which is what I've done for a couple of hours now :(

like image 22
Abdurrahman Avatar answered Oct 01 '22 20:10

Abdurrahman