Skip to content

Crash when trying to rename an export whose declaration is annotated with pathed JS Doc #36338

Closed
@RyanCavanaugh

Description

@RyanCavanaugh

TypeScript Version: 3.8.0-dev

Search Terms: JSDocNamepathType

Code

In a JS file

/**
 * @param {module:foo/Axis} x
 */
function createAxisTicks(x) { }
var Axis = 0;
exports.Axis = Axis;
//             ^ rename here

This is simplified from a file in https://github.com/apache/incubator-echarts

Expected behavior: No crash

Actual behavior:

    Debug Failure. Did not expect JSDocNamepathType to have an Identifier in its trivia

    Error: Debug Failure. Did not expect JSDocNamepathType to have an Identifier in its trivia
        at addSyntheticNodes (D:\github\typescript\built\local\tsserver.js:132918:30)
        at createChildren (D:\github\typescript\built\local\tsserver.js:132907:9)
        at NodeObject.getChildren (D:\github\typescript\built\local\tsserver.js:132851:56)
        at getTokenAtPositionWorker (D:\github\typescript\built\local\tsserver.js:105221:43)
        at getTouchingToken (D:\github\typescript\built\local\tsserver.js:105208:16)
        at Object.getTouchingPropertyName (D:\github\typescript\built\local\tsserver.js:105200:16)
        at getReferencesAtLocation (D:\github\typescript\built\local\tsserver.js:112889:44)
        at getReferencesInContainer (D:\github\typescript\built\local\tsserver.js:112882:21)
        at getReferencesInContainerOrFiles (D:\github\typescript\built\local\tsserver.js:112440:21)
        at getReferencedSymbolsForSymbol (D:\github\typescript\built\local\tsserver.js:112431:21)
        at Object.getReferencedSymbolsForNode (D:\github\typescript\built\local\tsserver.js:112234:34)
        at Object.findReferenceOrRenameEntries (D:\github\typescript\built\local\tsserver.js:111958:47)
        at getReferencesWorker (D:\github\typescript\built\local\tsserver.js:134089:41)
        at Object.findRenameLocations (D:\github\typescript\built\local\tsserver.js:134076:24)
        at D:\github\typescript\built\local\tsserver.js:142564:68
        at callbackProjectAndLocation (D:\github\typescript\built\local\tsserver.js:142683:13)
        at D:\github\typescript\built\local\tsserver.js:142627:24
        at forEachProjectInProjects (D:\github\typescript\built\local\tsserver.js:142609:17)
        at combineProjectOutputWorker (D:\github\typescript\built\local\tsserver.js:142624:13)
        at combineProjectOutputForRenameLocations (D:\github\typescript\built\local\tsserver.js:142562:13)
        at IOSession.Session.getRenameLocations (D:\github\typescript\built\local\tsserver.js:143692:33)
        at Session.handlers.ts.createMapFromTemplate._a.<computed> (D:\github\typescript\built\local\tsserver.js:142854:61)
        at D:\github\typescript\built\local\tsserver.js:144522:88
        at IOSession.Session.executeWithRequestId (D:\github\typescript\built\local\tsserver.js:144513:28)
        at IOSession.Session.executeCommand (D:\github\typescript\built\local\tsserver.js:144522:33)
        at IOSession.Session.onMessage (D:\github\typescript\built\local\tsserver.js:144545:35)
        at Interface.<anonymous> (D:\github\typescript\built\local\tsserver.js:145860:27)
        at Interface.emit (events.js:200:13)
        at Interface._onLine (readline.js:314:10)
        at Interface._normalWrite (readline.js:459:12)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions