-
Notifications
You must be signed in to change notification settings - Fork 126
HTTP Interface #495
base: master
Are you sure you want to change the base?
HTTP Interface #495
Conversation
- added an new HTTP Interface - added a new 'file_save', 'file_list', and 'file_delete' command - added a new 'add_dependency' and 'remove_dependency' command - added new test cases for the new commands and the HTTP Interface
ant.classpath{ant.pathelement(path: '${build.classes}/org.eclim')} | ||
ant.classpath{ | ||
ant.pathelement(path: '${build.classes}/org.eclim') | ||
ant.pathelement(path: '${build.classes}/org.eclim.jdt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to to use ${pluginName}
rather than hardcoding in jdt, which not all users may be able to compile (they may only be interested in running/testing cdt for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, thanks for the comment!
See changes in the next commit.
@@ -1130,6 +1133,7 @@ junit = { pluginName -> | |||
ant.path(refid: 'junit') | |||
ant.pathelement(path: "build/test/junit/classes/${pluginName}") | |||
ant.pathelement(path: '${build.classes}/org.eclim') | |||
ant.pathelement(path: '${build.classes}/org.eclim.jdt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this shouldn't be hardcoded as jdt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also done in the next commit.
int len; | ||
while ((len = in.read(buf)) > 0) { | ||
out.write(buf, 0, len); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this code and replace it with org.eclim.util.IOUtils.copy(in, out)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I did not see this Utility class.
I changed it -> See changes in the next commit.
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.eclim.plugin.jdt.command.dependency; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a package for .classpath
commands at jdt.command.classpath
. Can you move your new commands there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - i moved all my classes from the dependency package including the test cases to the classpath package.
See changes in the next commit.
import org.eclim.plugin.core.util.PathUtilException; | ||
|
||
@Command( | ||
name = "add_dependency", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency and to prevent collisions, all language specific commands have a common prefix. Since this is a jdt (java) command, this should have a java_
prefix. For consistency with the existing classpath commands I'd call this java_classpath_add_entry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - Changed the add_dependency and also the remove_dependency to java_classpath_add_entry and java_classpath_remove_entry.
See changes in the next commit.
@@ -1,4 +1,7 @@ | |||
pluginVersion=${eclim.version} | |||
nailgun.server.host=127.0.0.1 | |||
nailgun.server.port=9091 | |||
http.server.enabled=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please disable this by default. Currently no other users will be using this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - this was the initial reason why I introduced this flag -> I just forgot to set it to false by default.
Now changed -> See changes in the next commit.
I scanned through this and left some comments. I'll need to spend more time looking at this more closely and testing, but for the most part it looks good. Please run |
…iew round' of ervandew - build.gant: use ${pluginName} instead of hard coding - use IOUtils in FileSaveCommand - move org.eclim.plugin.jdt.command.dependency to jdt.command.classpath - disable http server by default - rename add_dependency and remove_dependency commands to java_classpath_add_entry and java_classpath_remove_entry
First: Thanks for your comments and your time you took to look at the code!
|
Note: Before you merge the code: Please run the junit tests on your machine to ensure all tests pass - i had to comment some tests out which did never run on my system (https://groups.google.com/forum/#!msg/eclim-dev/O8dqcvOEFWI/_VSC3ncmDwAJ) |
- changed wrong logging call (tried to log an object which is no instance of exception in an error logging call)
The HTTP Server returned an error message if a command returns null. Since there exist commands which return null when they succeed (e.g. project_refresh_file) we changed this. The HTTP Server now returns an empty string in the message if a command returns null.
…iew round' of ervandew - build.gant: use ${pluginName} instead of hard coding - use IOUtils in FileSaveCommand - move org.eclim.plugin.jdt.command.dependency to jdt.command.classpath - disable http server by default - rename add_dependency and remove_dependency commands to java_classpath_add_entry and java_classpath_remove_entry
- changed wrong logging call (tried to log an object which is no instance of exception in an error logging call)
The HTTP Server returned an error message if a command returns null. Since there exist commands which return null when they succeed (e.g. project_refresh_file) we changed this. The HTTP Server now returns an empty string in the message if a command returns null.
I just wanted to leave a note that I haven't forgotten about these pull requests. I've just haven't had the time to fully review them yet (I was hoping to tackle a couple the past weekend, but my internet went out friday afternoon and wasn't back until monday afternoon). |
hi @ervandew do you plan to have a look? |
Content of the pull request:
Reason for our pull request:
We are creating an online editor (we took codemirror as a base editor) which provides code completion functionality for groovy code. To achieve this, we run an eclipse instance in the background. To get the completion proposals out of eclipse we selected the eclim plug-in. Since eclipse should run in a docker image we do not want to use the “command line interface”, but would prefer a HTTP interface which provides the functionality of eclim.
We need the additional commands to control eclim completely over the HTTP Interface.
With the file_save command we can