简体   繁体   中英

How to hide Intellisense "based on recent edits" suggestions?

What the title says.

I don't mind them being in the "Error List" because they're only marked as "Messages" so they can easily be filtered, but I'd like to hide the dots in the code.

To turn off the "Based on recent edits" stuff, go to turn off IntelliCode suggestions .

Per the docs:

If you wish to turn it off, choose Tools > Options, IntelliCode General tab, and then switch C# suggestions to Disabled

在此处输入图像描述

This will turn off "Based on Recent edits" while still leaving on the other stuff like code styles/autocomplete/etc.

How to hide Intellisense “based on recent edits” suggestions?

If you want to hide such suggestion in Intellisense(show as a dot ), you should add this below on the top of every cs file:

#pragma warning disable xxx(suggestion ID)

Or use #pragma warning disable to disable every suggestion.

For an example, I have make a similar sample:

在此处输入图像描述

在此处输入图像描述

================================================================

And usually to remove that Intellisense Suggestion, you should enter Tools --> Options --> Text Editor --> C# --> Code Style and then find such suggestion message and change its Severity from Suggestion to Refactoring Only . With this, you could remove such Suggestion on Code Editor .

在此处输入图像描述

Since I did not know your specific suggestion message(based on recent edits) and the ID and also not sure whether such suggestion are in the Code Style menu, so I suggest you could try my first solution.

Note that: So far, no matter which way you suppress the suggestion, removing dot in the Code Editor will also remove the message in the Error List . They are unified, you cannot suppress the IntelliSense in the Code Editor and save the message in the Error List .

Besides, if you still want this,you could suggest a feature on our User Voice Forum .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM