Bug 574446 - Extending EclEmma for other langs
Summary: Extending EclEmma for other langs
Status: NEW
Alias: None
Product: Eclemma
Classification: Technology
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-24 11:41 EDT by Christian Dietrich CLA
Modified: 2021-06-25 01:01 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2021-06-24 11:41:15 EDT
This is a follow up of https://www.eclipse.org/forums/index.php/t/1091909/

the approach described there but it has a downside:
adaptables

AnnotationModel does 

 private ISourceNode findSourceCoverageForEditor() {
    if (editor.isDirty()) {
      return null;
    }
    final IEditorInput input = editor.getEditorInput();
    if (input == null) {
      return null;
    }
    final Object element = input.getAdapter(IJavaElement.class);
    if (!hasSource((IJavaElement) element)) {
      return null;
    }
    return findSourceCoverageForElement(element);
  }

so the problem is that you can have only one adapter factory from 
FileEditorInput to IJavaElement

maybe it would be easier to customize with

editor.getAdapter(IJavaElement.class);
before asking for editor.getEditorInput();

i also wonder if there could be a more general solution to get custom languages into emma so that they also show up in the coverage view

do you have any hints where to start looking

thanks
Comment 1 Marc R. Hoffmann CLA 2021-06-24 12:39:09 EDT
Hi Christian,

what about testing this idea with your specific scenario and report whether this actually works?

Regards,
-marc
Comment 2 Christian Dietrich CLA 2021-06-25 01:01:32 EDT
for my personal usecase it works

https://github.com/eclipse/eclemma/compare/master...cdietrich:cd_bug574446