Closed
Description
// @Filename: mod1.js
module.exports = { e: 1, m: 1 }
/** @typedef {number} Foo */
// @Filename: use.js
/** @type {import('./mod1').Foo} */
var foo = 12
Expected behavior:
Renaming Foo
in use.js should rename it. Find-all-refs on Foo
in use.js should list all references
Actual behavior:
Neither work. However, goto-def does work.
Activity
ghost commentedon May 3, 2018
@sandersn That example doesn't type-check (and goto-def doesn't work for me):
module.exports = { e: number, m: number };
fails becausenumber
is not a value, and/** @type {Foo} */
fails becauseFoo
was never imported. Also, I thought a comment that doesn't precede anything was ignored?sandersn commentedon May 3, 2018
import('./mod1').Foo
; I don't know if renaming Foo should work for `const mod1 = require('./mod1'); /** @type {mod1.Foo} */. Probably yes?