Resharper: how to suppress warning "Field xy is never used" in XAML - xaml

I want to suppress a warning in my xaml file. I applied the corresponding quick fix option to "Disable once warning by comment". However, the warning
is still active. How do I correctly suppress the warning? I would like to keep the name because it tells something about the purpose of the element. (An alternative would be to remove the name and use a comment.)
Edit
The issue is only valid vor Resharper version Build 8.2.0.2160.
After updating to 8.2.3 the suppression works correctly. (And in version 9 the warning does not seem to be active by default.) Thanks to citizenmatt.
The issue is still shown in the Inspection Results view, see related question Resharper: How to hide suppressed warnings in Inspection Results?
In this special case it makes more sense to use the Tag attribute (thanks to Mike Eason) or to use a comment to write the name instead of using a comment to suppress the warning.

This looks like an issue with an older version of ReSharper. You can update to the latest version of 8.x (8.2.3) or ReSharper 9 (the 9.2 EAP has just released EAP3). It appears to have fixed the issue.

Related

Where is the setting for highlighting unused variables and constants in Visual Studio 2022?

I am working in a C# project where this has been turned off.
I can't find out how to turn it on again.
It's pretty hard to google as it's default behavior, and no sane person would turn it off...
Did you perhaps change your compiler warning level?
Unused variables should have the warning of CS0168. If you look at that page, the title is "Compiler Warning (level 3) CS0168".
In solution explorer, right click your project and go to Build and check your Warning Level:
If you set it to anything lower than three, then the CS0168 warnings will never be shown. Also, just below the drop down is a suppress warnings text box. Make sure you don't have CS0168 in that text box.
Are you using an .editorconfig file?
If you are using an .editorconfig file, you may have suppressed this particular warning. Removing that suppression should resolve this as well. It would look something like this in your .editorconfig file:
[*.cs]
# CS0168: Variable is declared but never used
dotnet_diagnostic.CS0168.severity = none

Why does Xcode autocomplete always put my custom code snippets above actual completions?

I am using some personal Xcode snippets for shortcuts for like dispatching on main queue, or a #synchronized code. They have never interfered with Xcode's autocomplete function with regular methods.
Some time ago I've formatted my Mac, installed Xcode, and re-created the shortcuts the same way I did before:
Ever since, my shortcuts are always before anything else when autocompleting methods containing spaces, as seen below:
The completion for methods should obviously come before my custom snippets.
It also occurs before anything else on property completions either:
They should get listed and highlighted as I type d or dm, or s, sy and so on, just like the default snippets. They shouldn't be at top of everything.
Why would have it changed after the format, and how do I correct this (mis)behavior?
(I am currently on Xcode 9.3 but the problem used to occur before 9.3 too)
UPDATE: The issue still persists on Xcode 9.4.
UPDATE 2: The issue still persists on Xcode 10.1.
Well, there is a new update Xcode 9.4, try with the update because I had the same problem, my solution was delete Xcode and reinstall the latest version, but I think only you need to clear the configuration to return like a first launch.
In the release note for Xcode 9.3 says:
Text in the Code Snippets library filter bar now includes code completion shortcuts. (8147546)
User-defined code snippets now appear at the top of the library, rather than the bottom. (8901028)
You can read full changes here Xcode Releases Notes

Highlight things marked as obsolete

I recently did some refactoring in our code and marked some widely-used functions as obsolete. The problem now is, that I get not visual indicator when I use an obsolete function right away. I have to hover over the function call to get the popup with further information about that function, and even there the "deprecated" warning is not very prominent. As these functions are to widely-used and cause no real treat, setting the isError property is not an option.
I know that somewhere I saw obsolete functions that were highlighted with some kind of underlining, but I can not find an option that does that. Where is that option, or how else can I achieve a more eye-catching indication?
I have created a simple toy VB.Net console application in MSVS, as you can see in the image the items marked obsolete are underlined in green where they are used.
If you are not seeing this then you will need to provide some more details on your solution's settings - what type of project is it, what version of visual studio are you opening it in, is it the same version it was created in, do you have any third party code linter (eg ReSharper) in use... etc
EDIT: As you mention in your comment, the project's properties, including the Code Analysis settings, will affect whether this underlining show's correctly or not; you will need to ensure the correct rule-set is selected there.

Warnings in IntelliJ IDEA v12

The answer given for How to get Intellij Idea to display compilation warnings? no longer applies from version 12. There is no longer a messages panel, as far as I can see.
How can I see a full list of all warnings in the project in version 12?
This option and the Messages panel is on the same place as before in IDEA 12.0.3:
If you don't see it, it means that your project has no errors. Make any error and the panel will appear. Verify that Hide warnings is not enabled. Fix the error, Make the project again, you should see only warnings:
Note that Make is incremental, if there were no changes, it will not compile and report any old warnings, so you may need to Rebuild to see all of them.

Disable IntelliJ Warnings

It really annoys me that IntelliJ highlights certain 'errors' (that don't prevent successful compilation) the same way that real errors are highlighted. For example, a magic number is not really an error, but it will be flagged in exactly the same way as an incompatible type error.
How can I change this?
Go to Settings -> Inspections. Then you need to search through the long list for the offending inspection, which you can get the name of by hovering on the warning marker in the margin. You can change the severity of the inspection, whether it's an error, warning, etc. or just disable it altogether.
Edit: if you search for "magic" in Settings, you get the following, which should be helpful:
Whenever you see an inspection warning/error you can place the caret on it and press Alt+Enter (a light bulb also appears that tells you that). A menu will appear with suggested quick fixes. You may need to open a submenu by pressing Right, and you'll find "Edit inspection settings" there. Having invoked that, you may proceed as in hvgotcodes's answer :), it's just a faster way of getting to those settings.
As Michael Calvin said you can use the SuppressWarnings annotation. For example:
#SuppressWarnings("OptionalUsedAsFieldOrParameterType")
See https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/OptionalUsedAsFieldOrParameterType.html
Usually searching the internet for the exact description leads me to this.
Not directly relevant to the OP, but may be of use to future Googlers
I got to this question while trying to figure out how to disable IntelliJ IDEA's warnings about Guava functionalities that have been replaced by Java 8 features. I'm not able to use the Java 8 versions of these features in my case because of a library we're using that was built with Guava (despite being a Java 8 project). So to solve that, I added a SuppressWarnings annotation before any class using Guava:
#SuppressWarnings(Guava)
public final class...