UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 23 forks source link

MMTSyntaxPresenter - as an extension - must not take constructor arguments #451

Open ComFreek opened 5 years ago

ComFreek commented 5 years ago

E.g. ctrl.handleLine("extension info.kwarc.mmt.api.presentation.MMTSyntaxPresenter") fails since MMTSyntaxPresenter has a non-empty constructor:

class MMTSyntaxPresenter(objectPresenter: ObjectPresenter = new NotationBasedPresenter)

Note that while new MMTSyntaxPresenter() compiles fine, the default argument value gets lost via reflection, so the reflection only sees a constructor taking an ObjectPresenter. (Actually not totally lost, you can retrieve it with enough hackery).

We should remove the argument and override Extension#start. I'll probably do while refactoring the presenter anyway. (CC @bankinus, @rappatoni)

Does anyone use MMTStructurePresenter or FlatMMTStructurePresenter or AbstractMMTStructurePresenter apart MMTSyntaxPresenter itself? Sounds like they are dead code.