Exemplo n.º 1
0
  /*
   * Method declared on SelectionChangedAction.
   */
  @Override
  public void run(final ITextSelection selection) {
    // if (!ActionUtil.isProcessable(fEditor)) {
    // return;
    // }
    IErlModule module = fEditor.getModule();
    if (module == null) {
      return;
    }
    final Backend b = ErlangCore.getBackendManager().getIdeBackend();
    final ISelection sel = getSelection();
    final ITextSelection textSel = (ITextSelection) sel;
    final int offset = textSel.getOffset();
    try {
      String scannerModuleName = ErlangToolkit.createScannerModuleName(module);
      final OpenResult res =
          ErlideOpen.open(b, scannerModuleName, offset, "", ErlangCore.getModel().getPathVars());
      ErlLogger.debug("open " + res);

      // final String title =
      // "SearchMessages.SearchElementSelectionDialog_title";
      // final String message =
      // "SearchMessages.SearchElementSelectionDialog_message";

      if (res.isExternalCall()) {
        performNewSearch(SearchUtil.getRefFromOpenRes(res));
      }
    } catch (final Exception e) {
      // final String title = "SearchMessages.Search_Error_search_title";
      // final String message = "SearchMessages.Search_Error_codeResolve";
      // ExceptionHandler.handle(e, getShell(), title, message);
      ErlLogger.debug(e);
    }
  }
Exemplo n.º 2
0
 /*
  * (non-Javadoc) Method declared on SelectionDispatchAction.
  */
 @Override
 public void run(final ITextSelection selection) {
   final ErlangEditor editor = (ErlangEditor) getSite().getPage().getActiveEditor();
   editor.reconcileNow();
   final IErlModule module = editor.getModule();
   if (module == null) {
     return;
   }
   final Backend b = ErlangCore.getBackendManager().getIdeBackend();
   final int offset = selection.getOffset();
   try {
     final IErlProject erlProject = module.getErlProject();
     final IErlModel model = ErlangCore.getModel();
     final OpenResult res =
         ErlideOpen.open(
             b,
             ErlangToolkit.createScannerModuleName(module),
             offset,
             ErlModelUtils.getImportsAsList(module),
             model.getExternalModules(erlProject),
             model.getPathVars());
     ErlLogger.debug("open " + res);
     openOpenResult(editor, module, b, offset, erlProject, res);
   } catch (final Exception e) {
     ErlLogger.warn(e);
   }
 }
Exemplo n.º 3
0
 public static void createTaskMarkers(final IProject project, final IResource resource) {
   final IErlProject p = ErlangCore.getModel().findProject(project);
   if (p != null) {
     try {
       if (BuilderUtils.isDebugging()) {
         ErlLogger.debug("Creating task markers " + resource.getName());
       }
       // getMarkersFor(resource, p);
       getNoScanMarkersFor(resource, p);
     } catch (final ErlModelException e) {
     }
   }
 }