microsoft / microsoft/TypeScript
JSDoc @name tag does not function
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
- VSCode Version: 1.33.1
- OS Version: Windows 7 x86_64 (but I do not think that is relevant)
- Does this issue occur when all extensions are disabled?:
Yes
Steps to Reproduce:
- Write in a file with
.jsor.tsextension the below sample code:
/**
Construct a new component
@class Component
@classdesc A generic component
@param {Object} options - Options to initialize the component with
@param {String} options.name - This component's name, sets {@link Component#lastProperty}
@param {Boolean} options.visible - Whether this component is vislble, sets {@link Component#firstProperty}
*/
function Component(options) {
/**
Whether this component is visible or not
@name Component#firstProperty
@type Boolean
@default false
*/
this.firstProperty = options.visible;
/**
This component's name
@name Component#lastProperty
@type String
@default "Component"
@readonly
*/
Object.defineProperty(this, 'lastProperty', {
value: options.name || 'Component',
writable: false
});
}
const myComponent = new Component({});
- on a new line at the end of the document type
myComponentwith a dot at its end. - While the text-cursor is after the dot, press
Ctrl+Spaceto open the auto-completion list.
Current Behavior:
When you chose .js as file extension, only firstProperty is in the auto-completion list (with its type comment and so on).
But when you have it in a file with .ts extension, none of firstProperty and lastProperty will be detected, and JSDoc seems useless.
Expected Behavior:
Both firstProperty and lastProperty should be detected and get placed in the auto-completion list, and that no matter which of .js or .ts file extensions we are using.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied Component example in both .js and .ts files, then inspect the completion behavior after myComponent.. Compare which JSDoc-defined properties are detected in each file type; done means both firstProperty and lastProperty appear in completion lists for both extensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100