Skip to content

Codemirror changes break extension #11

Open
@JeffryBooher

Description

@JeffryBooher

It looks like this extension no longer does code completion because of recent changes to code mirror.

TypeScriptDocument.prototype.updateScriptWithChange = function (doc, change) {
        // Special case: the range is no longer meaningful since the entire text was replaced
        if (!change.from || !change.to) {
            // Update all the script
            this.updateScriptWithText(doc, doc.getText());
        }
        var minChar = this.getIndexFromPos(change.from, doc),
            limChar = this.getIndexFromPos(change.to, doc),
            newText = change.text.join('\n');

        this.lsh.editScript(getScriptName(doc), minChar, limChar, newText);
    };

In the code block above change is now an array of changes and, as such, change.from and change.to have moved to elements of the array. This code tries to resolve positions for undefined which fail causing other things to fail and code completion to stop workinig.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions