how to copy cleanupSettings from eclipse to intellij? - eclipse

I have a number of xml files, exported from eclipse, and I would like to stick to a common protocol with my eclipse-using colleagues. It has been suggested to me, that I can simply import the settings into IDEA. Now, I've figured out the files that I could need and how to import them (formatting, for example).
I am a bit confused about cleanupSettings.xml. What does it do? and will I gain any benefit in having the same "cleanup" as my colleagues. If so, how do I import them?
Or a better way to ask this, is : how do I, in intellij, do "cleanup" tasks, such as organise imports, and know that, when I reformat, these things will happen. Imagine I have a very specific action, such as prepend the source file with "asdf"

Related

How to import all files at once pointed out by Dart Analysis?

I just put some of my code from a/b.dart to a/b1.dart file and now I started getting lot of errors on importing.
Is there any command or any other fix to import all a/b1.dart file in these files instead of manually opening each file and importing one by one.
I understand that a function or a property can be defined in more than two files and Dart can't make the right choice but if a function or property is defined in just one place, I think there must be some way to import it except searching for a/b.dart and replacing it with a/b.dart + a/b1.dart and then optimizing all imports.
As much as I am aware, Plugins/Extensions for your specific IDE (for dart) can be found that will help you with this problem.
I would recommend using dartdev tools - dartfix

How to import a shared proto file in different packages?

import "google/protobuf/duration.proto";
For the above import statement, I wonder how protoc knows where to find that proto file, since it's obviously not in somewhere of my proto_path.
I have a shared.proto in some package, and could be refered by many projects, so I cannot put it to some project level to share the same protp_path. My question is how to refer this proto just like import duration.proto?
This is a good question for me because I know why it works but (still) don't fully understand how.
Why? Because the well-known types are bundled with protoc in a lib folder alongside the bin folder. I assume for e.g. Python, the implementation similarly includes these.
How? I think (!?) this works because protoc is configured (!?) to look for these types in that location (where is protoc? Look for lib in a sibling folder).
The documentation would benefit from explaining this because I used to manually add these to proto_path until once, when I didn't and worked without the import.

Newbie IDE (IntelliJ IDEA) issue: .class files not all usable

I'm working on a school project right now, and every time I have in the past, I always make a new Project in IntelliJ IDEA. However, this time she gave us some .class files that have methods in them that we can't see (she described what they do so we know how to use them) but need to use, so they have to be in the same folder, obviously.
SIDENOTE: I'm also new to using Macs, which is what I'm on at the moment.
Anyways, I put the .class files in my src folder that I found in the Project8 folder. I just made an array of the Book objects, which was one of the .class files I moved, and now I need to use a method from the other .class file, named BookInventory.class. I put that file in the src folder just like the other, but it won't let me use the only method in that class, which is LoadBooks.
Here is the LoadBooks signature:
public static void LoadBooks(Book[] b)
And here's the description of it that she gave to us:
"For each element in the array, accepts user input for the book, creates the Book object, and stores the object into the array."
So, when I made the array of Book objects, IDEA made an import statement up top all by itself, I didn't type it:
import java.awt.print.Book;
So why does IDEA recognize the Book.class file and allow me to use it in this .java file for my project, but it doesn't seem to notice the BookInventory.class file?
Any help appreciated, thanks ahead of time.
What is happening is when you first typed the line with LoadBooks(Book[] b), IntelliJ could not "see" your class files (you have subsequently loaded them in "class files" and added that as a project library, I presume).
IntelliJ however searched for and found a Book class in the internal java libraries, java.awt.print.Book. Note that this is a different class to the one your teacher gave you, which might have been e.g. edu.myschool.homework.Book.
Firstly, try to delete the line including the import statement, or manually change it to the correct package (your teacher can inform you what it is).
If the same import comes back automatically, you can go into Settings -> Editor -> General -> Auto Import and untick Add unambiguous imports on the fly - this will cause intellij to prompt you before adding imports.
Also, I would ask your teacher to give you the class files in a jar file, since that's the usual approach.
Good luck.

Rangy ClassApplier and browserify

I'm using browserify to manage dependencies. require('rangy') seems to only import rangy-core, but not its sub-modules.
How can I import rangy-classapplier?
If I import the file (require('./node_modules/rangy/lib/rangy-classapplier.js')) it works, but I'd like to do it without having to include the file address.
I think
require('rangy/lib/rangy-classapplier.js');
is what you want, at least as things are now. I don't see a neat way for me to make the path any simpler; I don't want to clutter the root directory. Possibly the rangy- prefix is unhelpful and I should get rid of it but I'll have a think about that.

Is there a way to tell Eclipse how to resolve ambiguous java names?

My eclipse is configured so that when I save the java source file, it automatically inserts the missing import declarations. Except when the reference is ambiguous. Fpr instance, the most annoying ambiguity is with List<T> - both java.util and java.awt declare it. Here eclipse demands manual resolution.
I was wondering if it was possible to configure somewhere that whenever List<T> is used then java.util should be imported. Or alternatively, since I am not using java.awt, I could just remove it from the list of possible suggestions.
Any ideas?
Thanks.
This sounds like a possible duplicate of Exclude packages from Eclipse's organize imports.
Basically, you want to change your Type Filters preference to exclude java.awt.* packages. Keep in mind that doing so will make things harder/confusing if you ever try to write AWT/Swing code.
One thing that pops into my mind is altering the class template in the preferences to include the line:
import java.util.List
Unless you are going to use the AWT version of a List, or care about unused import statements, that should solve this annoying issue ..
Manually invoke Organize Imports and it will ask you when an ambiguity is found.