<commit_before>package com.googlecode.goclipse.debug.ui;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.FileEditorInput;

import com.googlecode.goclipse.SysUtils;
import com.googlecode.goclipse.builder.GoConstants;

/**
 * 
 * @author steel
 *
 */
public class LaunchShortcut implements ILaunchShortcut {

   @Override
   public void launch(ISelection selection, final String mode) {
      System.out.println("launch shortcut: selection " + selection  + " mode " + mode);
      if (selection != null) {
    	  if (selection instanceof TreeSelection) {
    		  TreeSelection ts = (TreeSelection)selection;
    		  Object e = ts.getFirstElement();
    		  if (e instanceof IFile) {
    			  IFile file = (IFile)e;
    			  final String fName = file.getProjectRelativePath().toOSString();
    			  final String pName = file.getProject().getName();
    			  launch(pName, fName, mode);
    		  }
    	  }
    	  
      }

   }

   @Override
   public void launch(IEditorPart editor, final String mode) {
	   System.out.println("launch shortcut: editor" + editor.getTitle()  + " mode " + mode);<commit_msg>cleans sysout<commit_after>package com.googlecode.goclipse.debug.ui;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.ILaunchShortcut;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.FileEditorInput;

import com.googlecode.goclipse.SysUtils;
import com.googlecode.goclipse.builder.GoConstants;

/**
 * 
 * @author steel
 *
 */
public class LaunchShortcut implements ILaunchShortcut {

   @Override
   public void launch(ISelection selection, final String mode) {
      SysUtils.debug("launch shortcut: selection " + selection  + " mode " + mode);
      if (selection != null) {
    	  if (selection instanceof TreeSelection) {
    		  TreeSelection ts = (TreeSelection)selection;
    		  Object e = ts.getFirstElement();
    		  if (e instanceof IFile) {
    			  IFile file = (IFile)e;
    			  final String fName = file.getProjectRelativePath().toOSString();
    			  final String pName = file.getProject().getName();
    			  launch(pName, fName, mode);
    		  }
    	  }
    	  
      }

   }

   @Override
   public void launch(IEditorPart editor, final String mode) {
	   SysUtils.debug("launch shortcut: editor" + editor.getTitle()  + " mode " + mode);
{'fraction_non_alphanumeric': 0.1087866108786611, 'fraction_numerical': 0.0, 'mean_word_length': 3.8089080459770117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6615055', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1031, 'n_words': 200}