Skip to content

Undefined entity with immediate and prototype assignments causes language service errors #50751

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

Open
DanielRosenwasser opened this issue Sep 13, 2022 · 0 comments · May be fixed by #52646
Open
Assignees
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fix Available A PR has been opened for this issue Help Wanted You can do this Old-Crawler-Detected Detected by an older crawler (aka "fuzzer") running random TSServer operations on public code. Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Sep 13, 2022

In a JavaScript file:

Thing.abc = 123

Thing.prototype.def = 456

new Thing/**/();

Go-to-definition or find-all-refs on Thing

<semantic> Response received: definitionAndBoundSpan (3200). Request took 4 ms. Success: false . Message: Error processing request. Debug Failure. Expected declaration to have at least one class-like declaration
Error: Debug Failure. Expected declaration to have at least one class-like declaration
    at getConstructSignatureDefinition (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:142175:89)
    at getDefinitionFromSymbol (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:142170:20)
    at getDefinitionAtPosition (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:141951:120)
    at Object.getDefinitionAndBoundSpan (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:142082:31)
    at Object.getDefinitionAndBoundSpan (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:167969:38)
    at Session.getDefinitionAndBoundSpan (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:179350:83)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (c:/Users/Daniel/.vscode-insiders/extensions/ms-vscode.vscode-typescript-next-4.9.20220911/node_modules/typescript/lib/tsserver.js:178594:61)

Found at https://github.com/meteor/meteor/blob/511538e15abcc34f8cfcc206ffdd738ca4c12ddd/packages/mongo/remote_collection_driver.js#L4

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". labels Sep 13, 2022
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.9.0 milestone Sep 13, 2022
@DanielRosenwasser DanielRosenwasser added the Old-Crawler-Detected Detected by an older crawler (aka "fuzzer") running random TSServer operations on public code. label Oct 28, 2022
@typescript-bot typescript-bot added Fix Available A PR has been opened for this issue labels Feb 7, 2023
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Fix Available A PR has been opened for this issue Help Wanted You can do this Old-Crawler-Detected Detected by an older crawler (aka "fuzzer") running random TSServer operations on public code. Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
4 participants