Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to use variables like ${project_loc} in External Tools #5

Open
GoogleCodeExporter opened this issue May 2, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Hello,

I just encountered your plugin through the Eclipse Marketplace RSS feed,
and was immediately drawn to its use of a designated view for various
launch configurations. I am a heavy user of both Java Application and
External Tool launchers in Eclipse.

Sadly, most of my External Tools are not possible to execute using your
plugin, because I often use various variables to refer to resources in
Eclipse, for instance ${project_loc} to refer to any marked resource's
project root folder. Typically, when comfiguring an External Tool, I set
Working Directory to ${project_loc} to enable the tool to be run from any
project I am currently working with, not hardcoded to a specific path.

Anyway, this works well when I use the External Tools button because
Eclipse then keeps focus on the file I am currently working with. But if I
use your view and double click on the same External Tool I get the error
"Variable references empty selection: ${project_loc}", because Eclipse's
focus changes to the Runner view, instead of the file I am currently
working with.

So to sum it up, the plugin currently seems not to be usable for External
Tools which uses such variables. I have no idea if there is possible to
resolve these variables in views. Maybe there is possible to catch the
values of these variables each time the view gets focus, and before the
variables are cleared? And then substitute any variables when running an
external tool from the Runner view?

Just to give you a heads up :)

- Rune

Original issue reported on code.google.com by flobakk on 31 Mar 2010 at 12:57

@GoogleCodeExporter
Copy link
Author

Thanks Rune for pointing that out. We definietly didn't test that feature. I 
guess
it's not so difficult to get it work, becuase when you run/debug launch
configurations from the toolbar you also don't have focus on the active 
resource.
I'll track that issue. Thanks once more !

Original comment by [email protected] on 31 Mar 2010 at 8:44

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Looks like you were right. All variables are being populated using current 
focused
editor content. External Tool launches does not work also when run from eclipse
launch history and when editor is focused on for example .class file. When i 
switch
back to any .java file it works again (i used ${project_loc} variable). I 
assume that
i could even post this issue to the eclipse bug trucker, because ...

... in code, launch configuration is represented by ILaunchConfiguration. It's 
all
you need to run it (+run/debug mode). so launch configuration know which file 
to run
and in which project it is. having these information all variables could be 
populated
before launching configuration.

Original comment by [email protected] on 1 Apr 2010 at 5:37

@GoogleCodeExporter
Copy link
Author

I found similar issue and wrote a comment:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=292732

Original comment by [email protected] on 1 Apr 2010 at 6:06

@GoogleCodeExporter
Copy link
Author

Hi,
first of all i want to mention, that i like your eclipseRunner-Plugin very 
much. But i have the same problem like it was described in this issue. I 
followed your comment in eclipse bug tracking and answer says "we will not 
change it". So in the meanwhile, is there a solution for the problem? Maybe a 
new Variable like "selected in Navigator loc" or "last editor file loc" or smth 
like this?
Regards, Martin.

Original comment by [email protected] on 28 Apr 2011 at 1:46

@GoogleCodeExporter
Copy link
Author

It bothers me a lot, too , 
will try if we could handle it or not as my top priority.

Original comment by tonylovejava on 17 May 2011 at 6:59

@GoogleCodeExporter
Copy link
Author

For some Eclipse code tracing , 
the variables is base on org.eclipse.core.variables,

For the selected resource , it's coming from 
org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager

I think it's no chance to replace it in easy way , 
we could try to set the active part before we really launch the application,
but not sure if that will work or not.

Or maybe we could use our own variables to handle this ,(like Martin's 
suggestion.)
and we could try to fall back the variable to selected resource for user 
running without Runner. 

So next key-point is how to find last focus , I think there must be a way to do 
that,
since the Eclipse have back to last place hot-key already.

Keep digging the Eclipse code base.

Original comment by tonylovejava on 18 May 2011 at 12:37

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

No branches or pull requests

1 participant