Community
Participate
Working Groups
Mylyn has the following code that programmatically invokes a command: EvaluationContext context = new EvaluationContext(service.getCurrentState(), object); context.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, new StructuredSelection(object)); service.executeCommandInContext(new ParameterizedCommand(command, null), event, context); In the command handler the following code is invoked to retrieve the current selection: selection = HandlerUtil.getCurrentSelection(event) This selection is different from the selection that was set on the context using addVariable(). It seems that LegacyHandlerService.executeCommandInContext() ignores the context since it does not extend LegacyEvalContext. Eclipse SDK 4.1M2: I20100922-0843
For Mylyn we fixed it by using IHandlerService.createContextSnapshot(false) instead of constructing an EvaulationContext directly.
Paul, I think we fixed this with bug 333506? Though I suppose there's also bug 349721 to consider.
Fixed by bug 333506 PW