-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.3.2
Code
// ==== main.js ====
const foobar = require('./module');
foobar.foo
foobar.bar
// ==== module.js ====
/** @type {{ spacing: number, perLine: number }} */
const defaults = {
spacing: 2,
perLine: 6,
};
/**
* @param {{ spacing: number, perLine: number }} options
* @returns {{ spacing: number, perLine: number }}
*/
exports.foo = (options) => Object.assign({}, defaults, options);
/**
* @param {string} name
* @param {number} age
*/
exports.bar = (name, age) => {
return `The person named "${name}" is ${age} years old!`;
};I emulated the expected behavior by adding this at the bottom of module.js:
/** @type {{ foo(options: { spacing: number, perLine: number }): { spacing: number, perLine: number }, bar(name: string, age: number): string }} */
const exports = module.exports;Expected Behavior
IntelliSense in main.js
Hovering over references should work

IntelliSense in module.js
Hovering over the definitions should work

Hovering over references should work

Actual Behavior
IntelliSense in main.js
Works just fine in autocomplete

Or when hovering over references to imports

Failing IntelliSense in module.js
It works when hovering over the members themselves

Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue


