Prevent IDEA from inserting back quote when auto complete attributes - scala

When I autocomplete an attribute in scala IntelliJ IDEA, it insert it while surrounding it with back quote ` like this :
`myAttribute` instead of myAttribute
This is annoying and I'd love to remove this behaviour. How to do this ?

Intellij only does this if the attribute or the variable name you are using is also a keyword in scala. So that it may reference the correct one. And its the feature of scala and not intellij.
If it is happening for other cases too.. then please recheck your Intellij Scala Code style, or just RESET your intellij .

Related

How to make Scala Presentation Compiler happy with Binding.scala?

I use ENSIME to deal with Scala code, and ENSIME uses official Presentation Compiler. For all Binding.scala examples I looked at #dom functions result in "all is red" decoration (that is false positive error detection) for DOM fragments. Say this one example https://github.com/Atry/Binding.scala-sample results in "all is red" starting from the first div of the table definition.
I guess Eclipse users are also affected by the issue as far as Eclipse uses PC also.
How to resolve the issue?
use addEnsimeCompilerPlugin in addition to addCompilerPlugin. This will be addressed by https://github.com/ensime/ensime-server/issues/1152

Netbeans Java code suggestion options/plugin?

If I type Car.Mile and press ctrl-spacebar to autocomplete the member name, it does not bring up matches that don't begin with Mile at all. This is pretty annoying because so many methods are prefixed with get/set/is like getMileage() and setMileage().
My code completion options look like this currently. Not seeing this as a choice. This is JMonkeyEngine's version of Netbeans, if that matters.
Anyway to get this behavior?
Don't use the settings for "All Languages" use the Java settings:

Finding unused methods in scala using Intelli J

I am working on a scala project in IntelliJ and want to clean up my code.
For this, I am looking for a way in which I can get a list of unused methods within my project.
This link didn't answer my question. It is for Java and not for Scala.
Finding unused methods in IntelliJ (excluding tests)
Analyze -> Inspect Code for Scala in IntelliJ has an option to select unused symbol but I am unable to drill it down to only check methods.
Go to Analyze -> Inspect code
Under Inspection Profile click on "..." and make sure "Unused declaration" is checked. Chose Whole project option and then OK.

Auto fix common typo in eclipse

Lets say for example I write many times priavte instead private.
Is there a way to let Eclipse automatically fix my common typo?
Something like construct a map of my common typo to its desire fix,
and then just let Eclipse fix it without asking me about that.
Are there any other IDE\editors that have such support?
There is no builtin support for automatically changing strings. The closest to your request are the templates of the Java editor, but even those must explicitly be activated using CtrlSpace.
To get around your problem, I suggest simply not to write that much yourself. If you want to declare a private field, type just "pr" and hit CtrlSpace to invoke code completion. Eclipse can do code completion quite well, often even without any trigger characters (try it with an empty class file).

Eclipse caret jumps to constructor while typing

While typing in Eclipse (Java) I often have the problem that when I begin to type accessors, the caret jumps down to the beginning of the constructor definition. So in a document like this:
private int mSomeInt;
public
in|public MyClass(){
}
I would like to manually type out the accessor (getter/setter) for mSomeInt, but when I press space after 'public' above, the caret jumps to the beginning of 'public MyClass'.
I often type complete lines to look up and find my methods jumbled with the constructor (like above).
Any help would be appreciated.
Note - this isn't only with accessors but rather any access modifiers that I define before the constructor or another method.
Edit
After unsuccessfully trying Deco's solution below, I've managed to narrow it down a little further.
The problem only happens if I have all the blocks in the file in a collapsed state (ctrl+shift+numPadDivide). I can see the problem is now that the new access modifier I type is then (quickly) collapsed into the below method. i.e. Eclipse is actually taking the first accessor modifier and collapsing everything from there, even though my intention is actually to write a new method.
The only solution I've been able to find is to only edit the source with all the 'fold' elements unfolded.
Under Window -> Preferences -> <Language> (e.g. Java) -> Editor there is a Content Assist menu item where you can configure auto completion and caret placement as well as auto-activation of it and the delay it uses.
Edit:
After your update to the original question I was able to successfully replicate this in Eclipse Indigo. When you have all of the code blocks collapsed it looks like Eclipse assumes that the code you are writing needs to be in that block (rather than as a variable declaration). I'm not sure if this is expected behaviour or not - but the only way around it I've found is to edit the code with the main block open, and then close it after the fact - or turn folding off altogether.
From what I can tell there are various folding plugins/addons that you can get for Eclipse which override the default behaviour and might function better? A quick Google search will be able to get you a list of them quickly.
I'd probably also suggest posting this as an issue on the Eclipse support site for their official answer.
Unfortunately this issue still exists for me in the latest Elcipse version (Kepler).
As the issue only occurs when the document is 'folded', the work around this is to either disable folding in the editor - or disable folding on 'Members' from the :
Preferences -> Java -> Editor -> Folding