Description:
Host Alice has a Module which contains a test folder, sources folder, and a <modulename>.iml file. There are two classes in the src folder.
If the Host shares this Module in Intellij with Bob, Bob gets all the files (.java and .iml) but not the whole Module.
Problem 1: The folders containing the files are only shown as directories, independent of their host-side status (e.g. Module, src folder, test folder, etc.). As a result, Bob cannot create classes (as it's only possible in Java Module src folders, not in plain directories).
Problem 2: Empty folders are not transmitted.</modulename>
Problem-Analysis:
Comparing the two projects of Alice and Bob, the result is following:
In the .idea folder (which contains the project meta data), there are differences in
All other files are equivalent (except for own system configurations).
In the modules.xml file all Modules of the project are listed, and the transmitted Modul does not appear there. After copying the module.xml file from the Host to the client the corresponding module is shown correctly.
Another Problem (not solved with the Approach to Solution) is that nested Modules (Modules in Modules) are not transmitted correctly, because its hard to compute the path to the inner .iml file.
Approach to solution
Intellij provides a ModuleManager through the OpenAPI, which has a method "loadModule" to load a Module from an .iml file and add it to the project. This solves the problem.
To call this method, it is recommend to register a new class in the SarosLifeCycleListener and the Picocontainer so the method is called every time when Ressources are shared.
It is also appropiate to embed this method with
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
loadModule(filepath);
....
to secure thread safety.
The .iml files of the sender/reciever seem fine and are equivalent on both sides.
Are you aware of the .idea/modules.xml (github.com)?
@Franz:
I did a div between the two preojects of the Host/Client, the result is following:
all empty folders are only host-sided
there are differences between
misc.xml
workspace.xml
modules.xml
in the .idea folder (META Data of project)
the transmitted files are missed in modules.xml client-sided, and the Host has some components as "EntryPointManager", "FileEditorManager" and "EditorHistoryManager" which doesnt appear client-side. There are also some minor differences which i think are referable to the different PCs i tested this.
This should be part of the bug description, not the discussion on it.
Diff:
What does "marked as error-prone" mean?
If a .java file exists in a folder where it doesnt belong, Intellij mark this file with a red J (maybe error-prone is the wrong word for it. Not maybe, certainly).
Well, then please change the bug description to something that makes sense.
Diff:
Would you please make sure your spelling is correct ("preojects", "div", ...) and use some markup (or markdown, to be precise) to structure the bug description? Click on the little question mark in the top right corner of the text field to learn more about the syntax.
I think you should ensure that all files are transmitted.
Eclipse has the same "issue" but that does not matter. We just create an empty non language specific project and when the .project file is being created or overwritten, Eclipse will correctly update the project.
Diff:
Diff:
I reformatted the description and cleaned up the sentences.
https://github.com/saros-project/saros/blob/master/de.fu_berlin.inf.dpp.intellij/src/de/fu_berlin/inf/dpp/intellij/ui/wizards/AddProjectToSessionWizard.java#L228
Should be a good start.
Diff:
Diff:
Diff:
It would be nice if the author of the patches would update the bug tracker and not someone else of the current staff.
3cb588ed45f708163a6a9d853308c52616910776
Last edit: tobous 2017-03-16