elan-language / LanguageAndIDE

Apache License 2.0
3 stars 0 forks source link

Typing 'cla..' results in an abstract class. #676

Closed richardpawson closed 2 months ago

richardpawson commented 3 months ago

In other word the general approach to 'overtyping' does not work in this situation.

The cause of this is that optionalKeyword (parse node) overrides the default implementation of processKey(e: editorEvent) and does not call the logic for handling overtyping.

Stef: can you, at the same time, please change the API for the overtyper, currently, this is called (in AbstractField) thus:

  private processInput(key: string) {
    if (this.overtyper.preProcessor(key)) {

I don't find that code easy to read/understand. What is meant by this.overtyper.preProcessor(key) returning true vs. false? Does true mean that the key has already been consumed by the overTyper ? And what is the distinction between the overTyper and its preProcessor? Please change names and/or restructure the overtyper API so that code using it reads closer to English statements.