Skip to content

Error: Debug Failure. False expression: Changes overlap #40983

@oblitum

Description

@oblitum

TypeScript Version: 4.0.3 and nightly

Search Terms: Error: Debug Failure. False expression: Changes overlap

Code

I'm not a typescript developer, so I don't have a code snippet to reproduce the error. This error is happening while I edit personal project code while using coc-tsserver for LSP diagnostics. The issue happens when it requests code fixes for the following reduced code snippet:

var Q = require("q");

module.exports = {
  search: function () {
    var deferred = Q.defer();
  }
}

From what I can tell, it seems it's being triggered because the code fixes indeed overlap, which is suggestion for unused variable (deferred) and the suggestion for converting the module to ES6 module, which reformats it as a whole. This is the stack trace when I hover over the first line and check for quick fixes:

Error on request (quickfixes): Vim(return):Error invoking 'quickfixes' on channel 3 (coc):
Error processing request. Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":23,"end":101} and {"pos":85,"end":92}
Error: Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":23,"end":101} and {"pos":85,"end":92}
    at _loop_10 (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:130016:34)
    at /home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:130022:25
    at Object.mapDefined (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:610:30)
    at Object.getTextChangesFromChanges (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:130010:27)
    at ChangeTracker.getChanges (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:129978:45)
    at Function.ChangeTracker.with (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:129426:32)
    at Object.getCodeActions (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:132160:64)
    at /home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:130599:77
    at Object.flatMap (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:513:25)
    at Object.getFixes (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:130599:23)
    at /home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:143796:35
    at Object.flatMap (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:513:25)
    at Object.getCodeFixesAtPosition (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:143794:23)
    at Proxy.<anonymous> (/home/francisco/.config/coc/extensions/node_modules/coc-styled-components/node_modules/typescript-template-language-service-decorator/lib/template-language-service-decorator.js:144:20)
    at IOSession.Session.getCodeFixes (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:154662:64)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:153339:61)
    at /home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:154962:88
    at IOSession.Session.executeWithRequestId (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:154953:28)
    at IOSession.Session.executeCommand (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:154962:33)
    at IOSession.Session.onMessage (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:154986:35)
    at Interface.<anonymous> (/home/francisco/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib/tsserver.js:157202:27)
    at Interface.emit (events.js:314:20)
    at Interface._onLine (readline.js:337:10)
    at Interface._normalWrite (readline.js:482:12)
    at Socket.ondata (readline.js:194:10)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:307:12)
    at readableAddChunk (_stream_readable.js:282:9)
    at Socket.Readable.push (_stream_readable.js:221:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Expected behavior: No error

Actual behavior: Long debug stack trace

Related Issues: #27700

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions