Bug 565972 - Eclipes Variable like project_loc , git_branch are not getting resolved when tabs like console or Problem are clicked
Summary: Eclipes Variable like project_loc , git_branch are not getting resolved when ...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-11 02:52 EDT by Ankit Kumar CLA
Modified: 2020-08-12 02:50 EDT (History)
2 users (show)

See Also:


Attachments
Contains build_destination, git_branch, project_loc stacktrace (113.73 KB, image/png)
2020-08-11 02:52 EDT, Ankit Kumar CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ankit Kumar CLA 2020-08-11 02:52:16 EDT
Created attachment 283827 [details]
Contains build_destination, git_branch, project_loc stacktrace

If I am using eclipse variable like project_loc , git_branch in my build destination, they are not getting resolved when I switch to tabs like Console or Problems.
For more info see the attached image.

In case of project_loc, see the image project_loc-stacktrace.log.

In case of git_branch, see the image git_branch-stacktrace.log.

In my opinion, we should resolve above eclipse variable even if a user is switching tab to console or problem or any other bug.

I did some digging, you should be looking into the below code:

https://git.eclipse.org/r/plugins/gitiles/egit/egit/+/b2ef308d8e60aee4876873ef8797495958b719da/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/variables/GitVariableResolver.java#130
Comment 1 Rolf Theunissen CLA 2020-08-11 03:32:24 EDT
Not sure what you are trying to accomplish. I get the impression that you are requesting something that might not be possible within the design of Eclipse, or at least not the way you expect it.

The variables you are using are resolved using dynamic value resolvers [1,2]. Some of these resolvers are provided by Eclipse Platform, others are provided by other projects, such as the egit you are referring too.

I can imagine that these value resolvers cannot resolve variables when for instance the Console is selected. There is no relation between a Console and a project. For a resolver it would be very hard to guess which in which context to resolve, would it be the last selected Editor, the last selected resource in a Project/Package Explorer, etc.

So what are you trying to do? What is the use-case that is not working due to the variables that are not resolved?


[1] https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Fvariables%2FIDynamicVariableResolver.html
[2] IDynamicVariableResolver
https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Fvariables%2FIDynamicVariableResolver.html
Comment 2 Maurice Stassen CLA 2020-08-12 02:48:45 EDT
In my opinion your resolver should resolve the variable (like $git-branch) at the start of an action (like build) and then for that action until the action completes it should change anymore.
Now when i start a build in projext X using a variable and i change to another project Y (during the build), build X is corrupted.
Comment 3 Maurice Stassen CLA 2020-08-12 02:50:10 EDT
in my previous comment i meant: "...it should NOT change anymore..."