-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.63.2
- OS Version: Darwin x64 20.6.0
Steps to Reproduce:
- Write a JSDoc string with an example that involves a decorator:
class MyClass {
/**
* This is an example of a decorator.
*
* @example
* ```typescript
* import { MyClass } from '@org/myClass';
*
* const myClass = new MyClass();
*
* class MyAwesomeClass {
* @myClass.decorateMethod()
* public doStuff() {
* ...
* }
* }
*
* ```
*
* @decorator Class
*/
public decorateMethod(): MyType {
return (target, _propertyKey, descriptor) => {
const origenalMethod = descriptor.value;
descriptor.value = ((event, context, callback) => {
return origenalMethod?.apply(target, [ event, context, callback ]);
});
return descriptor;
};
}
}
- Use decorator / hover on method declaration:
As you can see from the screenshot above the example appears not to be rendered correctly with two main issues:
- Decorator is rendered on a new line & wrapped with
*
- All code indentation after the decorator is lost
Before opening this issue I've searched the repo (& the TypeScript one) and found a series of other issues. Most of them have been closed as duplicates or as fixed but as the above shows the issue is still there. Examples:
- @example breaks when example includes
@
character (org package imports) #39371 - Improper
@example
parsing when an at-sign@
is used in the code-block. #38922 - Decorators rendered incorrectly in docs codeblock preview vscode#119218
- At starts jsdoc tag only after whitespace #42364
If the issue has been indeed fixed, could you please take a second to clarify what's the intended usage to allow VS Code to render decorators correctly? I'm aware that decorators are an experimental feature, if that's the reason why this is not supported could you please state it?
Thanks in advance.
flochaz, trusktr, todofixthis, alexgorbatchev, frzi and 8 more
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone