Skip to content

TSServer: Rename errors on non-existent property #27373

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

Closed
mjbvz opened this issue Sep 26, 2018 · 2 comments
Closed

TSServer: Rename errors on non-existent property #27373

mjbvz opened this issue Sep 26, 2018 · 2 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Sep 26, 2018

From microsoft/vscode#59426

TypeScript Version: 3.2.0-dev.20180926

Search Terms:

  • rename
  • tsserver

Code
In a TS file:

class Foo  {
    constructor() {
        this.bar = 1;
    }
}

Trigger a rename on bar

bug
The rename request fails with:

[Trace  - 11:46:15 AM] Sending request: rename (247). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/san/a.ts",
    "line": 3,
    "offset": 15,
    "findInStrings": false,
    "findInComments": false
}
[Trace  - 11:46:15 AM] Response received: rename (247). Request took 2 ms. Success: false . Message: Error processing request. Cannot read property 'start' of undefined
TypeError: Cannot read property 'start' of undefined
    at IOSession.Session.toLocationTextSpan (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122830:65)
    at IOSession.Session.mapRenameInfo (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122428:242)
    at IOSession.Session.getRenameLocations (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122423:39)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:121655:61)
    at /Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123133:88
    at IOSession.Session.executeWithRequestId (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123124:28)
    at IOSession.Session.executeCommand (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123133:33)
    at IOSession.Session.onMessage (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123153:35)
    at Interface.<anonymous> (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:124417:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
[Trace  - 11:46:15 AM] Sending request: getCodeFixes (248). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/san/a.ts",
    "startLine": 3,
    "startOffset": 14,
    "endLine": 3,
    "endOffset": 17,
    "errorCodes": [
        2339
    ]
}
[Error  - 11:46:15 AM] 'rename' request failed with error.
Error processing request. Cannot read property 'start' of undefined
TypeError: Cannot read property 'start' of undefined
    at IOSession.Session.toLocationTextSpan (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122830:65)
    at IOSession.Session.mapRenameInfo (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122428:242)
    at IOSession.Session.getRenameLocations (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:122423:39)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:121655:61)
    at /Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123133:88
    at IOSession.Session.executeWithRequestId (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123124:28)
    at IOSession.Session.executeCommand (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123133:33)
    at IOSession.Session.onMessage (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:123153:35)
    at Interface.<anonymous> (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:124417:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 26, 2018

@RyanCavanaugh We hit this one pretty often in my testing. I think a fix should go into 3.1.5

@ghost ghost mentioned this issue Sep 26, 2018
@ghost ghost added Bug A bug in TypeScript Fixed A PR has been merged for this issue labels Sep 26, 2018
@ghost ghost added this to the TypeScript 3.1 milestone Sep 26, 2018
@ghost ghost closed this as completed in #27382 Sep 27, 2018
zzbot added a commit to ycm-core/ycmd that referenced this issue Sep 27, 2018
[READY] Fix TSServer 3.1.1 test failures

- TSServer 3.1.1 GetType does error on keyword, except `class`.
- microsoft/TypeScript#27373

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/1112)
<!-- Reviewable:end -->
@DanielRosenwasser
Copy link
Member

3.1 fix is in cd1803f

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants