public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
if (selection instanceof ITextSelection) {
final ITextSelection textSelection = (ITextSelection) selection;
final String text = textSelection.getText();
if (part instanceof ScriptEditor) {
ScriptEditor scriptEditor = (ScriptEditor) part;
try {
IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();
IRegion region = doc.getLineInformation(textSelection.getStartLine());
String string = doc.get(region.getOffset(), region.getLength());
return string.indexOf('=') != -1 || string.trim().startsWith("var ");
} catch (BadLocationException e) {