Skip to content

get (or set) function shows description from *both* get and set function on hover #20966

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

Closed
mjbvz opened this issue Jan 2, 2018 · 2 comments · Fixed by #37451
Closed

get (or set) function shows description from *both* get and set function on hover #20966

mjbvz opened this issue Jan 2, 2018 · 2 comments · Fixed by #37451
Labels
Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jan 2, 2018

From @kleinfreund on December 24, 2017 9:36

  • VSCode Version: Code 1.19.1 (0759f77bb8d86658bc935a10a64f6182c5a1eeba, 2017-12-19T09:41:01.414Z)
  • OS Version: Linux x64 4.13.0-21-generic
  • Extensions: Extensions are disabled

Steps to Reproduce:

  1. View the following code with language mode set to JavaScript

    class Test {
      constructor() {
        this.value;
      }
    
      /** Getter text */
      get value() {
        return this.value;
      }
    
      /** Setter text */
      set value(value) {
        this.value = value;
      }
    }
  2. Hover over the value getter (or setter) function

Expected behavior:

Getter text (or Setter text) appears in the box as the function description.

Actual behavior:

Getter text Setter text appears in the box as the function description.

Copied from original issue: microsoft/vscode#40775

@mjbvz mjbvz self-assigned this Jan 2, 2018
@mjbvz mjbvz removed their assignment Jan 2, 2018
@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Jan 2, 2018
@mjbvz
Copy link
Contributor Author

mjbvz commented Jan 2, 2018

TS 2.7.0-insiders.20171214

Here's the TS server requests/responses:

[Trace  - 11:13:13 AM] Sending request: quickinfo (212). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/san/x.ts",
    "line": 13,
    "offset": 14
}
[Trace  - 11:13:13 AM] Response received: quickinfo (212). Request took 3 ms. Success: true 
Result: {
    "kind": "property",
    "kindModifiers": "",
    "start": {
        "line": 13,
        "offset": 12
    },
    "end": {
        "line": 13,
        "offset": 17
    },
    "displayString": "(property) Test.value: any",
    "documentation": "Getter text \nSetter text ",
    "tags": []
}

@mhegazy mhegazy added Suggestion An idea for TypeScript Help Wanted You can do this Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". labels Jan 4, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jan 4, 2018

The current behavior now is for symbols with multiple declarations we combine all the comments. this is to address cases where declarations merge.

We could try and filter the jsdoc based on whether the access to the symbol is a read or a write. that will require some rewiring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants