TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

JavaScript IntelliSense does not suggest methods added to built-in prototypes

Open sangafabrice opened this issue 2 weeks ago • 1 comments

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.106.3
  • OS Version: Windows 10 22H2

Steps to Reproduce:

  1. Ensure javascript.suggest.enabled is set to true:
/** @file .vscode/settings.json */
{
    "javascript.suggest.enabled": true
}
  1. Create a JavaScript file with the following content:
Promise.prototype.log = function() {
    this.then(console.log)
}

const promise = new Promise(r=>r(3));
promise.log();
  1. Place the cursor after promise. (before log()) as shown below

Image

  1. Observe that the log method is not suggested by IntelliSense, even though it exists on the prototype of Promise.

sangafabrice avatar Dec 08 '25 03:12 sangafabrice

Global merges like this aren't supported; you'll need to use a .d.ts file for this

RyanCavanaugh avatar Dec 09 '25 20:12 RyanCavanaugh

This issue has been marked as "Not a Defect" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

typescript-bot avatar Dec 12 '25 01:12 typescript-bot