microsoft / microsoft/TypeScript

Handle JSDoc @param with hyphen

Open
#20,801 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: JSDoc Experience Enhancement Suggestion VS Code Tracked
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 2.7.0-dev.20171214

Code

/**
 * @param x - Bla
 */
function foo(x) { }

Hover over x

Expected behavior:
Hyphen is ignored in any documentation returned. See JSDoc @param spec: http://usejsdoc.org/tags-param.html

Actual behavior:
Hyphen is returned as part of documentation:

[Trace  - 2:58:07 PM] Response received: quickinfo (144). Request took 3 ms. Success: true 
Result: {
    "kind": "parameter",
    "kindModifiers": "",
    "start": {
        "line": 4,
        "offset": 14
    },
    "end": {
        "line": 4,
        "offset": 15
    },
    "displayString": "(parameter) x: any",
    "documentation": "- Bla",
    "tags": []
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the TypeScript JSDoc @param handling used by the quickinfo hover response shown in the issue. Reproduce the sample, trace where the documentation string is formed, and verify that the returned documentation omits the separator hyphen while preserving the description.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.