Simple debug breakpoint conditions gives me "Unused equals expression" - android-studio

I don't know what is wrong here. It happened before to me also when I tried conditional breakpoints some weeks before. Do I do something wrong or it's Android studio bug ?
Also when I leave this there another error pop up:

Ok looks like android bug to me or multiple... Conditional breakpoint on field don't work and it works when I do the same thing in function. That warning Unused equals expression persist thou.
So what I did to actually make it work was to create temporary init function, placed call to log something and placed breakpoint with the same condition there.
Unused equals expression warning is quite confusing to me as well as that conditions don't work on fields at last for me, maybe its related that I am running arctic fox preview on M1 mac ? Don't know maybe its just well known bug..
Also that null pointer can be logical because when compiler first gets there commands is actually still null so maybe I could just write condition as notes.createPlayCommands().size == 0 and only real Android Studio bug is that warning of unused equals expression un debug breakpoint view.

Related

Android Studio does not find usage of some methods and fields

When I try to find usages (Alt F7 or Mouse-Click with CTRL-Button down on the method name at the declaration) of a Java method or field in Android Studio (Version 3.5.3) I am often receiving the message "No usages found in all places" although the method/field is definitely used - often even in the same class.
Is there some kind of index which needs to be updated?
Or any other idea, why obviously existing usages are sometimes not found.
Found it: There is a menu entry "File->Invalidate Caches/Restart ...".
After trying that, everything worked fine again.
Hope this helps others when running into the same problem.
BTW: Pretty dangerous if one relies on the wrong usage information and starts to delete unused methods...

How do I get typo warnings in locale-specific strings.xml according to my custom dictionaries in Android Studio?

Same question here, but I'll try to explain it better.
I want Android Studio to give me typo warnings according to my custom dictionaries. Typo inspections are enabled properly. I have already set up my project dictionary and portuguese.dic in settings, and spell checking works fine in code.
It also works in values/strings.xml (the default locale) but it doesn't work in locale-specific xml resources, like values-pt/strings.xml. It gives me warnings for common misspellings for pt language (which it detects automatically), but I want the typo warnings that assume every word is wrong except for the ones present in my dictionaries.
I have tried changing the tools:locale attribute to many values, but the problem remains: this affects only the "common misspellings", not typo spell-checking, which is disabled for the file no matter what I do.
I even tried disabling the Inspection for "common misspellings" (Android/Lint/Correctness/Messages/Spelling error) but it didn't work either.
Is this a bug in IDEA/Android Studio? It seems to be this way by design, but maybe there is a setting or something I'm missing.
Is there a way to enable this check, or some workaround to make it work?
Ideally this should just work in the editor, but if not possible, it would be fine to have at least a gradle script or something that I can run once to make sure everything is OK.

Android Studio 3.1.2 0 - no longer see errors in all files (red underlined)

I feel like I'm going crazy, but since updating to the new version of Android Studio, I can no longer tell which files have errors in them.
Previously, if I made a change in one class, like to a method signature, then all other classes that were calling that method would suddenly be highlighted in red (at that section along the top that shows the path). Now it shows nothing as though my code is good, except when I go to compile, I now get a load of errors in the build tab at the bottom, in a really unhelpful way to navigate through.
Is this something I can switch back to through a setting somewhere? I'm really not sure what to search for, but I've been through almost all of them.
UPDATE :
Following another SO post, I turned on and off PowerSave mode, at the bottom of File menu (in Android Studio). This, temporarily at least, seems to have solved things.
This may be what you are looking for?
Either that or it may be in preferences.

How do I prevent Resharper Javascript Intellisense from replacing 'function' with 'Function'?

I have a problem where 'function' is almost always replaced by 'Function' even after I type the entire word, which is happening all too often and drives me absolutely batty. I have to back up and replace the first letter. Any way to adjust this? I don't even know where I'd use 'Function'.
JetBrains appears to have this issue logged as a bug and supposedly fixed. Problem is that the fix seems to be first applied to 7.0.1 but is now apparent in the latest 8.1 again.
http://youtrack.jetbrains.com/issue/RSRP-330134
I have made comments, but if anyone else is also having this problem please continue to add to the thread.

Have you used JustCode?

Has anyone used JustCode from Telerik lately? This question has been asked about two years ago, but I'm sure the issues must have been resolved by now. Especially referring to running it side by side with ReSharper.
I have been using Resharper for a while now. I decided to try JustCode to see how it behave.
After a week of using JustCode, I am uninstalling it and returning to Resharper.
What I like about JustCode:
A single window indicating all warnings/errors in entire solution.
Performance seemed to be a bit better than Resharper.
Refactoring is easier to get to.
Projects can be excluded, or type of file
Language can be excluded (such as XAML)
What I did not like about JustCode:
Sometimes the underline used to open the option for fixing or refactoring is frustratingly hard to click since VS also puts an underline at the same spot (and it is the context menu of the latter that pops up).
Cannot change an hint to be a warning instead.
Saw some minor bugs
JustCode was giving hundreds of false positive warnings in the XAML code (luckily I could turn the inspection of XAML off)
What I was missing from Resharper:
Warnings about method parameter missing/mismatch from the documentation
Hints to transform an expression into a Linq expression.
When writing an opening bracket, resharper automatically adds the closing one and puts you on an empty line in between the two.
When completing a method, Resharper adds the first parentheses. It also adds the last one if that method is parameterless.
I am sure there is a bunch of other stuff that I can't remember now
You can install both Resharper and JustCode alongside. I first suspended Resharper before installing JustCode and used JustCode fine. When I resumed Resharper and restarted VS, both were running together without error.
Together, Resharper was finding more than JustCode.
For example, JustCode did not give a warning for the following: "Value assigned is not used in any execution path."
It even missed an error: "Cannot convert type 'int' to 'bool'." The expression was:
if ((bool)CanDoIt) // Here CanDoIt is a property of type int.
{
...
}
All in all, the tool is not bad. I recommend it over not having any. But if you have the choice between Resharper and JustCode, go with Resharper... for the moment; JustCode is still young.
You can change the size of JustCode's smart tag or turn off Visual Studio's smart tag in JustCode's options menu. I prefer to access VS's smart tag by using ctrl+., so it hasn't been an issue for me.

Resources