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.
Related
I copied some code from here to make an extension compatible with Visual Studio 2019 to replace the built-in outlining because it does not collapse the curly braces in catch & finally block.
Now the extension works fine as the picture shows below.
But there is only one thing I'm not satisfied with. When I move the mouse to the collapsed part, it just shows plain text tooltip without any color or format.
I would like to make the tooltip look like the built-in one. But I don't know where to start.
I did some research about this. I may need to change the hoverText in this code.
return new TagSpan<IOutliningRegionTag>(span, new OutliningRegionTag(false, false, GetCollapsedText(), hoverText));
I think it might involve with Classification, ITooltipService or something else.
I'm new to this, could anyone give me some advice? Some demo code or document would be great help. Thanks.
Code is here: CSharpOutline2019
After a night long research, I finally found a solution and achieved my goal.
In case anyone would be interested with this question, I'll try to exlpain how it works, giving a general idea.
Import IProjectionBufferFactoryService to create the hover TextBuffer
Import ITextEditorFactoryService to create a IWpfTextView to show the hover content
Replace the parameter hoverText with IWpfTextView in the code I mentioned above
return new TagSpan<IOutliningRegionTag>(span, new OutliningRegionTag(false, false, GetCollapsedText(), hoverText));
That's pretty much it. And I found the solution here.
The extension works great, the tooltip looks just the same as the default one.
The complete code will be uploaded to CSharpOutline2019 soon.
How do I disable auto-indentation feature/bug? (Xamarin 6.11, Mac)
Note: <CURSOR HERE> designates position of cursor and not actual code.
Here are my steps:
I place my cursor as shown:
I press ENTER:
I type my declaration and jump to beginning hoping to fix indentation:
I press BACKSPACE:
Pressing ENTER again at this point brings me back to step 3.
Please help, it's driving me nuts!
Oh yes, changing indentation in Preferences->Code Formatting->C# ... does not affect the behavior, even with restart.
See: https://forums.xamarin.com/discussion/2509/incorrect-auto-formatting-of-c-code-for-specific-functions
Look down to where it says Text Editor -> Behavior.
There is an option named "Enable on the fly code formatting"; You may want to disable this if you wish to format your own codes.
There is also the Smart Indentation mode in Behavior you might want to turn off.
When I write a method call and open bracket, and then get a tooltip to parameters of method. It's great.
Then I press Ctrl + Space to get a list of possible parameters. The tooltip with method parameters is moved up and an IntelliSence hint is opened down. This is also fine. However, the parameters are covered up by an uninformative message: "Press tab to replace highlighted range". See a figure below:
It's really annoying. How can I disable it?
I reverse engineered the Resharper and found a configuration setting that manages a display of “Press tab to replace highlighted range” tooltip. This parameter is:
<s:Boolean x:Key="/Default/Housekeeping/IntellisenseHousekeeping/HintUsed/#EntryValue">True</s:Boolean>
You could add this line in any configuration file and Resharper will disable the tooltip. I use the “This computer” configuration file:
%AppData%\JetBrains\ReSharper\vAny\GlobalSettingsStorage.DotSettings
I just noticed this today and it is amazing! I hate typing out the brackets. But why does this only work for 'else' statements? I want this after namespace, class, struct, enum, for, foreach, while, switch, do, and method headers.
Is there any way to turn this functionality on with a wider scope?
For some of them you hit tab twice to auto complete the block.
try Tools > Options > Text Editor > C# > IntelliSense.
You can use the spacebar to select whatever is highlighted in the IntelliSense popup.
OR
You can just type the next character you would type AFTER having normally finished typing.
For example.
I want to enter:
console.writeline
I just type con.wr(" and the rest auto-fills with the correct spacing.
It gets "Smarter" the more you use it.
Type the word "prop" then hit TAB twice. Watch what happens. Then you can hit tab to switch between the parameters.
Here is a Youtube tutorial on using IntelliSense, there might be more resources in there for you.
http://www.youtube.com/watch?v=k6Q0NR2Z0nc
Is there an easy way to add an Text field to an UIAlertView an get the text out of it?
The input fields in UIAlertView are supported natively by iOS SDK 5 and higher. If you need to support version 4, you'll need a bit of hacking.
I once made some sample code for Montouch. Not very clean but it should give you the idea:
http://wildsau.net/post/2011/01/28/iOS-UIAlertView-with-a-UITextField-a-MonoTouch-implementation.aspx
And, yes, this will be approved by Apple without problems.
As of iOS5 you can add textfields to UIAlertViews including secure password fields. Here is a tutorial link:
http://mobile.tutsplus.com/tutorials/iphone/ios-5-sdk-uialertview-text-input-and-validation/
iOS 5.0 introduced UIAlertViewStyle. There are 4 to choose from, the default one we always had, plus 3 others that include UITextFields.
If you want to support iOS versions prior to 5.0 though, you can customize these alertViews yourself (I did this in the app I just released). You can add either/both UITextFields and UILabels this way.
I implemented the alertView like this:
UIAlertView *changeEmailAlert = [[UIAlertView alloc] initWithTitle:#"Change Email Address" message:#"\n\n" delegate:self cancelButtonTitle:#"Cancel" otherButtonTitles:#"OK", nil];
The message (\n\n) has line breaks to make enough room to fit the size of my UILabel and UITextField.
Then, just add the UILabel and UITextField as subviews of the UIAlertView, the same as you would add a subview anywhere else.
Here is the important part: You need to save the text in the UITextField before dismissing the alertView. I use -(void)textFieldDidEndEditing:(UITextField *)textField to get the entered text and save it in a variable that will be accessible later.
If you need a non-iOS5-only solution, UIAlertViews are just views like anything else. You can subclass them, add additional properties and subviews.
There's nothing stopping you from creating a UIAlertView subclass that has a textfield property, implements the textfield delegate protocol and adds the textfield to its own view hierarchy when you instantiate it.
Getting it to looks nice may be trickier, and doing stuff like moving the other subviews around to make space for the text field may involve some fragile hacks like looping through unnamed subviews within the alert view and grabbing one by index. But this is pretty much the only way to do this on iOS4 and earlier, and plenty of app have taken this approach.