Feature Addition: Added Ability to Run Launch Configurations in Eclipse from vim #177

Closed
wants to merge 13 commits into
from

Conversation

Projects
None yet
4 participants

Hi,
I added a few commands so that you can now run launchers in eclipse.
The commands are:
ProjectRun
ProjectRunDebug
ProjectList

ProjectRun and ProjectRunDebug have autocompletion setup, and allow running based off of the index of the launch configuration or the name.
ProjectList gives a nice formatted list of the launch configurations.

Also, added a command in org.eclim.core to implement the Eclipse functionality.

tyler-dodge and others added some commits Nov 17, 2012

@tyler-dodge tyler-dodge Add the ability to run build configurations in vim ecf21fe
@ervandew @tyler-dodge fix opening of file:<path> urls 7a7c613
@ervandew @tyler-dodge :ProjectTree, try t:cwd after current eclim project
when no arg is supplied, have :ProjectTree check t:cwd as well as
current eclim project, so that :ProjectTree and :ProjectTreeToggle can
be used in conjuction with :ProjectTab <dir>.
7b6b1e3
@ervandew @tyler-dodge fix import command when current file open in eclipse editor 62e2852
@ervandew @tyler-dodge force the commit when formatting correction, etc changes 3d05643
@ervandew @tyler-dodge suppress git error + don't notify user if indigo branch isn't available
it needlessly gives the user the impression that something is wrong with
the build.
42fd38a
@tyler-dodge tyler-dodge Update build.gant to include necessary jars 256ab00
@tyler-dodge tyler-dodge Merge remote-tracking branch 'origin' 9c77db5
@tyler-dodge tyler-dodge Add option -l to ProjectRun b9ea366
@tyler-dodge tyler-dodge Add ability to list Run Configurations and call Run Configurations by…
… index
275bc60
@tyler-dodge tyler-dodge Did some cleanup 7540c81
@tyler-dodge tyler-dodge Add support for autocompletion in Run Configurations aabb8b2
@tyler-dodge tyler-dodge Add support for running BuildConfigurations in DebugMode 213284f
Owner

ervandew commented Nov 18, 2012

Awesome! From a quick scan this looks good, but I'll have to take some time to test it out and review it further, also there are a couple other things I'd like to finish up ahead of this as well, so it may be a little while before I can get this merged in.

ajoslin commented Nov 19, 2012

Wow, I've been wanting this feature too. Please merge it asap 😄

Owner

ervandew commented Nov 21, 2012

I've started playing with this and I have some feedback:

  • It seems that these command are really only useful if the eclipse gui is running, so the first thing I would do is only define these commands when vimplugin is running
  • I would expect :ProjectRun with no arguments to behave like eclipse's Ctrl+F11 shortcut and execute the most recently used run configuration for the current project... same with :ProjectRunDebug.
  • I'm not sure how I feel about the :ProjectRun command completing and allowing running of configurations outside of the current project. I suppose it could come in handy occasionally, but if you have several projects, it seems like unnecessary noise most of the time and could lead to accidentally running the wrong configuration (I did this once already). Perhaps :ProjectRun! could be used to run a config outside the current project, and the completion could look for the bang when deciding whether to complete other configs as well.
  • I think :ProjectRunList should output a message if no configurations are found, and again should limit results to the current project, using :ProjectRunList! to list all configs grouped by project with the project name included in the output (I don't see the value of printing an index in the output... is there a motivation behind that?).

Thanks for the feedback!

  • Makes sense to me, my ideal usage for it was with the Headed eclipse running eclim server, because that's the mode I use. I wasn't sure how to target it only for those so I didn't look into that much.
  • Yeah, that would make sense from a feature standpoint, I could look into adding that.
  • My main usage was with multiple projects in the same workspace, but I could see how that would be more consistent with the rest of Eclim
  • No configurations found should be pretty easy to add, so I'll do that shortly. Yeah, I'll look into grouping it by project, that should come pretty easily with limiting ProjectRun as well. I put the indices there so that you could just do :ProjectRun 0, or :ProjectRun whatever_index.

ervandew reopened this Nov 21, 2012

Ah sorry, didn't mean to close it. Anyway, I looked into trying to associate ILaunchConfiguration with a project, I haven't been able to find anything linking the two. Do you have any idea if anything exists for that?

Owner

ervandew commented Nov 28, 2012

I poked around a little bit and the only way I see to tie a launch configuration to a project is via the config's mapped resources:

ILaunchConfiguration[] configs = DebugPlugin.getDefault()
  .getLaunchManager().getLaunchConfigurations();
for (ILaunchConfiguration config : configs){
  IResource[] resources = config.getMappedResources();
  IProject prj = resources != null && resources.length > 0 ?
    resources[0].getProject() : null;
  println("config: " + config.getName() + " project: " + prj);
}
Owner

ervandew commented Nov 28, 2012

I should also note that the code I posted worked for the standard java launch config and for a test android config I have. In theory it should work for any launch configuration which needs access to a project file/resource, which most if not all of them should.

Any reason this never ended up being merged? A feature like this would be pretty handy.

I just haven't had time to implement the changes Eric was looking for. I keep putting it off, because I don't usually work with eclipse and I wanted this mainly for one other project I was working on. I'm planning on getting to add the suggested changes sometime this month hopefully though.

Owner

ervandew commented Nov 4, 2014

Closing this in favor of #354 which is almost ready to be merged.

ervandew closed this Nov 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment