-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Hovering over JSDoc annotation resolves differently to Intellisense #32845
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
Comments
@brendanarnold I'm trying to repro this now and having trouble with this part:
I'm just not seeing that autocomplete? In my observation, the |
Yeah I just revisited the test case setup and cannot reproduce myself now either with 1.42.0. What I find instead is that if you name the Happy to close the issue. |
Well, it may still be a bug. Let me write up a clearer repro of what I think is the problem. // account.js
// @ts-check
/**
* @class
*/
class Account {
constructor() {
this.foo = 'foo'
}
}
/**
* @class
*/
class OtherName {
constructor() {
this.foo = 'foo'
}
}
module.exports = {
Account,
OtherName
} // bar.js
// @ts-check
const { Account, OtherName } = require('./account.js')
/**
* @type {Account}
*/
let a;
a.foo // error: Property 'foo' does not exist on type 'Account'
/**
* @type {OtherName}
*/
let b;
b.foo // OK Expected: This could potentially be by design, but I suspect not since the TypeScript "equivalent" favors the imported // account.ts
/**
* @class
*/
class Account {
foo: number
}
/**
* @class
*/
class OtherName {
foo: number
}
export { Account, OtherName } // b.ts
import { Account, OtherName } from './account'
let a: Account
a.foo // OK
let b: OtherName
b.foo // OK |
@sandersn any comment on the JSDoc behavior in #32845 (comment) ? Expected? |
It is not expected. It's a bug in the commonjs Basically, it looks like There might be an existing issue tracking this. #25533 is basically right as far as I remember. |
Issue Type: Bug
It's possible when hovering over the JSDoc annotation for it to resolve to a different object to what Intellisense will autocomplete to.
To re-create ...
Hovering over the JSDoc will resolve it to the
lib.d.ts
Account
interface but when typing thea.foo
inmain
it will autocomplete to the correct Account class.VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:56:38.504Z)
OS version: Darwin x64 18.6.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Extensions (10)
The text was updated successfully, but these errors were encountered: