Skip to content

Hovering over JSDoc annotation resolves differently to Intellisense #32845

Open
@brendanarnold

Description

@brendanarnold

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 ...

// account.js

/**
 * @class
 */
class Account {
  constructor () {
    this.foo = 'foo'
  }
}

module.exports = {
  Account
}
// index.js

const { account } = require('./account.js')

/**
 * @param {Account} a
 */
const main = (a) => {
  a.foo = ''
}

Hovering over the JSDoc will resolve it to the lib.d.ts Account interface but when typing the a.foo in main 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
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)
GPU Status 2d_canvas: enabled
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
Load (avg) 2, 2, 2
Memory (System) 16.00GB (1.87GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (10)
Extension Author (truncated) Version
scratchpad awe 0.1.0
insert-unicode bru 0.6.0
vscode-standardjs che 1.2.3
gitlens eam 9.8.5
nunjucks-template ese 0.1.2
vscode-docker ms- 0.7.0
addDocComments ste 0.0.8
code-spell-checker str 1.7.17
vscodeintellicode Vis 1.1.8
vscode-todo-highlight way 1.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: Quick Infoe.g. hover text, tool-tips, and tooltips.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions