Skip to content

"Quick info" and "go to definition" not working inside old school JavaScript constructor functions #57157

@jakub-g

Description

@jakub-g

Perhaps related to #55910

  • VSCode Version: 1.26.1 stable, 1.27.0 insiders
  • OS Version: Win 10
    Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create JS file with contents like this (this kind of constructions are quite often used in old school mixin-based frameworks)
function MyAwesomeConstructor() {
  /**
   * @return {Number} Always 42
   */
  this.foo = function() {
    return 42
  }

  this.bar = function() {
    this.foo()
  }
}

const myObject = new MyAwesomeConstructor()
  1. Hover line 10: this.foo() call

Expected:

  • On hover, quick info with the this.foo jsdoc from the beginning of the file is displayed
  • On Ctrl+clicking on foo(), the editor should move me to the definition

Actual:

  • Quick info stating any is displayed
  • Not possible to Ctrl+click

Note: When you write myObject. and do CTRL_SPACE, both foo and bar are correctly suggested.

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions