-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: length < 0 in createTextSpan
during getApplicableRefactors
#20809
Comments
The |
@aozgaa Can I assume this is from 2.6.1, like the others? |
var pos = nodeIsMissing(errorNode)
? errorNode.pos
: ts.skipTrivia(sourceFile.text, errorNode.pos);
return ts.createTextSpanFromBounds(pos, errorNode.end); It seems plausible that |
This is the diagnostic we're trying to create: if (!isStatement(nodeToCheck) && !(isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) {
return [createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)];
} |
|
Yes. All reported issues so far are from 2.6.1. I've updated the description to reflect this. |
Waiting for asserts to be hit (not yet shipped). |
We had a telemetry hit in VS Code 1.28.1 with TS 3.1.1:
|
Closing in the absence of a concrete repro |
tsserver version: 2.6.1
Error: length < 0
at createTextSpan (tsserver.js:8817:19)
at Object.createTextSpanFromBounds (tsserver.js:8823:16)
at getErrorSpanForNode (tsserver.js:6264:19)
at createDiagnosticForNodeInSourceFile (tsserver.js:6195:20)
at Object.createDiagnosticForNode (tsserver.js:6191:16)
at checkNode (tsserver.js:77699:36)
at getRangeToExtract (tsserver.js:77655:54)
at Object.getAvailableActions (tsserver.js:77509:38)
at tsserver.js:75017:128
at Object.flatMapIter (tsserver.js:1570:23)
at Object.getApplicableRefactors (tsserver.js:75016:23)
at Object.getApplicableRefactors (tsserver.js:80232:32)
at IOSession.Session.getApplicableRefactors (tsserver.js:86474:53)
at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:85436:61)
at tsserver.js:86669:88
at IOSession.Session.executeWithRequestId (tsserver.js:86660:28)
at IOSession.Session.executeCommand (tsserver.js:86669:33)
at IOSession.Session.onMessage (tsserver.js:86689:35)
at Interface. (tsserver.js:87881:27)
at emitOne (events.js:96:13)
at Interface.emit (events.js:191:7)
at Interface._onLine (readline.js:241:10)
at Interface._normalWrite (readline.js:384:12)
at Socket.ondata (readline.js:101:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20)
The text was updated successfully, but these errors were encountered: