This could not get weirder I was trying to run this snippet when it gives an error at following line
IStructuredSelection selection = viewer.getStructuredSelection();
gives suggestion to change but does not help anyone knows how to resolve this issue.
Any help is greatly appreciated.
Seems like I should trust eclipse a little more
resolved it looks like it is working fine but I wont know unless I completely implement it