rcjsuen / dockerfile-language-server

A language server for Dockerfiles powered by Node.js, TypeScript, and VSCode technologies.
MIT License
372 stars 15 forks source link

didChange should not require the range to be set #227

Closed docwhat closed 6 years ago

docwhat commented 6 years ago

didChange should handle events that don't have the range and rangeLength set.

The documentation for a didChange event:

/**
 * An event describing a change to a text document. If range and rangeLength are omitted
 * the new text is considered to be the full content of the document.
 */
interface TextDocumentContentChangeEvent {
    /**
     * The range of the document that changed.
     */
    range?: Range;

    /**
     * The length of the range that got replaced.
     */
    rangeLength?: number;

    /**
     * The new text of the range/document.
     */
    text: string;
}

However, when using LanguageClient-neovim I get this error:

[Error] Notification handler 'textDocument/didChange' failed with message: Cannot read property 'start' of undefined

The only place in the code that invokes the property start is line 551 of server.ts.

rcjsuen commented 6 years ago

@docwhat Thank you very much for the bug report. I have fixed the issue and it should be included in the next release of the language server.

Please do not hesitate to open up another issue if you find something else that seems off.