Skip to content

Index refactoring #154

Description

@gohabereg

Currently Index class is very inconvenient to use and mixes several different indexes in one: text, block, key in data, key in tunes, key in document properties.

It might be more convenient if we split those indexes into child classes of an abstract Index class. Something like:

abstract class Index {
  static text(documentId, block, key, textRange) {
    return new TextIndex(...);
  }
  static data(documentId, block, key);
  ....

  serialize() {
    ....
  }
}

class TextIndex extends Index {
  constructor(documentId, block, key, textRange) { ... };
}

Also now composite index is handled differently and always have to be considered when working with text selection. It would be more convenient if we always treat text index as segmented, but it would have just one segment if it's not cross-input

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions