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.
Related
I have a file with loads of redundant x?.let { it.something() } and I want to keep them this way.
How do I suppress the warning? IDE doesn't offer suppression here. I've looked into Errors.java and DefaultErrorMessages.java but nothing seemed to fit.
More general question: what arguments are supported by #Suppress annotation?
Like I said in the comment on the other question, just use the IDE to suppress warnings - every warning popup has a 'More Options' link, or you can put the cursor on the highlighted bit of code and do Alt+Enter (or whatever) or click the lightbulb. Then you'll get a list of actions for the warning, and you can hit the right arrow to get options for each one - the main action (the "fix it" one) has options that allow you to suppress the warning instead:
There's no defined set of possible things you can suppress, because things like lint checks can be added to over time (or by using libraries that provide their own checks), IDE features can be expanded, etc. Like the language spec says:
kotlin.Suppress is used to optionally mark any piece of code as suppressing some language feature, such as a compiler warning, an IDE mechanism or a language feature. The names of features which one can suppress with this annotation are implementation-defined, as is the processing of this annotation itself.
So it's better to let the IDE do it automatically since it knows the name of the inspection being triggered when it warns you about a thing, so it can create the appropriate annotation.
Generally you shouldn't be suppressing these anyway, they're highlighting code that has issues, is unnecessarily complex, or that isn't actually what you think it is (like in my example there, I'm treating the value as potentially null - but it's not actually a nullable type). It's better to fix the issue rather than suppress it and leave the intent ambiguous. Even if you know what it means and what it's supposed to do, someone who comes along later might be confused by it (possibly Future You!). There are some situations where it's necessary or useful, but generally speaking the warnings are there for a good reason.
Been getting into Android Studio (and Android development in general) lately, mostly a personal challenge to make a modern version of an app my mum loves but hasn't been updated in ages. But my life story isn't the point, and that's not just because it's not that interesting.
The actual question:
Is there a way to make Android Studio do automatic folding for block comments (i.e. /* to */) in Kotlin files? In Settings > Editor > Code Folding there's options for documentation (in general) and multiline comments for C or Java, but no settings specific to Kotlin, and just one for Android in general (which has nothing to do with comments).
The reasoning: Because I'm still pretty new at this, there's a lot of things I've tried but haven't worked, and comment out instead of deleting because I still might be able to learn something from them later. There's also some big blocks of logging code for debugging that are great when I'm trying to debug but in the way (given I usually write them in the middle of classes or methods) when I'm not, so I comment them out. It's just annoying having to fold several sections of comments whenever I open a file.
The "well duh" solution?: I could set them as documentation comments, which would hopefully get automatically folded, but if I start writing documentation (like I really should get around to) they'll get mixed in and that would be annoying.
What I've tried so far: Going through all the settings with a fine tooth comb (and I'll freely admit I could have gone over something obvious) and searched for plugins for code folding, about the only one I could find is https://plugins.jetbrains.com/plugin/12007-foldingplus which doesn't seem to do anything about this particular problem.
Can anyone help me out here, other than maybe "be less of a newbie in general"?
With Android Studio Arctic Fox I found that if you highlight a region that has the comments in question, you can right-click on it and one of the options will be Folding. From the expanded options select Fold Selection / Remove Region and the selected comments will fold.
PROBLEM
The Android Studio IDE (macOSX) has issues with Syntax/Intellisense. I'm running Flutter/Dart on it to code and compile a Flutter app. I have the latest install to date and I have the latest flutter/dart sdks as of date.
If I create a new file and start working in it, something causes the syntax highlighting and intellisense to break. This appears to happen within minutes of opening up Android Studio. I have to close it and reopen it for it to resume. When it breaks, other files seem to keep their syntax highlighting, but it no longer updates if I work in them. It keeps old errors on the page regardless of the code I change. Is there a fix for this?
EDIT
I found the problem has to do with type definitions, particularly when defining a Future type for a class method.
REPRODUCE
Open up your flutter project (doesn't matter what it is).
Go to your services code (or code that works with Future).
Create a new method with a future return type with a generic specified. Do this by hand, just start typing it in, do not copy paste: Future<List<asdfasdf>>.
After writing Future<List< it should break. It should do it every time for you like it is for me.
If I'm not working with Future, it doesn't break. The way I'm getting around it is defining the method with the future before defining the generics. So I first write Future myMethod() async { } make sure the syntax is correct and there's no errors, then I go in and define the generic.
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.
I tried to use JSLint.VS2012 extension to check the JavaScript code. it is useful for it found a lot syntax issues in my code. However, is it possible to configure the rules in JSLint to enable/disable certain rules? Currently, I'd like to switch off 2 rules:
1) The code format checking. Because I use Visual Studio 2012 as the editor, it has a default code formatter, the formated code is OK for me. But, seems JSLint requires a different code format style, so I prefer VS2012 auto format feature, and need switch off the JSLint rule. Here is a snapshot shows JSLint complaining the 'bad' formatted code.
2) The second I want to be disabled rule is "Unexpected 'else' after 'return':
I don't this rule is good, but guarded return could improve the readability of if-else switches, below is a snapshot:
This has been silent long enough I'll at least answer for VS 2008 and hope it's similar for the VS 2012 plugin.
Question 1: Go to your tools menu. Select "JSLint Options". Look for "Tolerate sloppy whitespace", and check it. Hopefully the 2012 version has a similar checkbox.
Question 2: The second is a little nastier. I don't believe there's a setting to turn it off, but even the VS plugin just uses the JSLint javascript file under the hood (or at least the 2008 version does via Noesis). So if you want, you can open up jslint.js and edit it.
If you edit this part, the error is ignored:
if (peek(0).id === '}' && peek(1).id === 'else') {
// commented out >>> this.warn('unexpected_else');
}
Voila. The JSLint code really is good, clean stuff that's easy to customize. But I am required to say that you really should take JSLint's advice, and in this case, I'd tend to agree. But inherited code? Comment the line out and keep moving along.