Package melnorme.lang.tooling.ast

Examples of melnorme.lang.tooling.ast.SourceRange


    return startPos + source.length();
  }
 
  @Override
  public final SourceRange getSourceRange() {
    return new SourceRange(getStartPos(), getLength());
  }
View Full Code Here


    if(fdResultEntry == null || fdResultEntry.isLanguageIntrinsic()) {
      dialogInfo("Cannot open definition, "
          + "symbol \"" +fdResultEntry.extendedName + "\" is a language intrinsic.");
      return;
    }
    final SourceRange sourceRange = fdResultEntry.sourceRange;
    if(sourceRange == null) {
      String msg = "Symbol " + fdResultEntry.extendedName + " has no source range info!";
      throw LangCore.createCoreException(msg, null);
    }
   
View Full Code Here

    List<FindDefinitionResultEntry> results = new ArrayList<>();
    for (INamedElement namedElement : defElements) {
      final DefUnit defUnit = namedElement.resolveDefUnit();
     
      Path compilationUnitPath = null;
      SourceRange sourceRange = null;
     
      if(defUnit != null) { // This can happen with intrinsic elements
       
        compilationUnitPath = defUnit.getModuleNode().compilationUnitPath;
        sourceRange = defUnit.defname.getSourceRangeOrNull();
        if(defUnit.getArcheType() == EArcheType.Module && sourceRange == null) {
          sourceRange = new SourceRange(0, 0);
        }
      }
     
      results.add(new FindDefinitionResultEntry(
        namedElement.getExtendedName(),
View Full Code Here

  }
 
  /* ---- Source range helpers ---- */
 
  public static SourceRange srAt(int offset) {
    return new SourceRange(offset, 0);
  }
View Full Code Here

    return startPos + source.length();
  }
 
  @Override
  public final SourceRange getSourceRange() {
    return new SourceRange(getStartPos(), getLength());
  }
View Full Code Here

    }
   
    protected FindDefinitionResultEntry findDefResult(Object object) throws GenieCommandException {
      Map<String, Object> resultEntry = blindCast(object);
     
      SourceRange sr = null;
     
      Integer offset = getIntegerOrNull(resultEntry, "offset");
      if(offset != null) {
        sr = new SourceRange(offset, getInt(resultEntry, "length"));
      }
     
      return new FindDefinitionResultEntry(
        getString(resultEntry, "extendedName"),
        getBoolean(resultEntry, "isIntrinsic"),
View Full Code Here

    public int getOffset() {
      return region.getOffset();
    }
   
    protected SourceRange getElementRange() {
      return new SourceRange(region.getOffset(), region.getLength());
    }
View Full Code Here

  }
 
  protected void openEditorForLocation(SourceLineColumnLocation location) throws CoreException {
    IEditorInput newInput = getNewEditorInput(location.path);
   
    SourceRange sr = new SourceRange(0, 0);
    ITextEditor newEditor = EditorUtils.openEditor(editor, EditorSettings_Actual.EDITOR_ID,
      newInput, sr, openEditorMode);
   
    IDocument doc = EditorUtils.getEditorDocument(newEditor);
    int selectionOffset = getOffsetFrom(doc, location.line, location.column);
   
    EditorUtils.setEditorSelection(newEditor, new SourceRange(selectionOffset, 0));
  }
View Full Code Here

    createOperation(editor, OpenNewEditorMode.TRY_REUSING_EXISTING_EDITORS).executeAndHandle();
  }
 
  public AbstractEditorOperation createOperation(ITextEditor editor, OpenNewEditorMode newEditorMode) {
    TextSelection sel = EditorUtils.getSelection(editor);
    SourceRange range = new SourceRange(sel.getOffset(), sel.getLength());
    return createOperation(editor, range, newEditorMode);
  }
View Full Code Here

   
    @Override
    public void open() {
      textEditor.doSave(new NullProgressMonitor());
     
      SourceRange sr = new SourceRange(region.getOffset(), region.getLength());
      new GoOracleOpenDefinitionOperation(textEditor, sr, OpenNewEditorMode.TRY_REUSING_EXISTING_EDITORS)
        .executeAndHandle();
    }
View Full Code Here

TOP

Related Classes of melnorme.lang.tooling.ast.SourceRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.