-
Notifications
You must be signed in to change notification settings - Fork 12.8k
[BUG] Detect decorators as a JSDoc tag inside @example block. #35310
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
Comments
There doesn't seem to be a formal specification for JSDoc syntax, so syntactically speaking, how would the compiler disambiguate this? |
At least, we should be able to use an escape character to ignore/avoid tag recognition by TS compiler. For example: /**
* Component that creates log event objects based on raw inputs sent to 'ILogger'.
*
* To customize what data is sent to the sinks, replace the implementation for this interface with your own.
*
* @example
*
* \@singleton
* export class MyLogEventFactory {
* public createLogEvent(logger: ILogger, logLevel: LogLevel, message: string, optionalParams: unknown[]): ILogEvent {
* return {
* logLevel,
* optionalParams,
* toString() {
* return "aaa";
* }
* };
* }
* }
*
* container.register(Registration.singleton(ILogEventFactory, MyLogEventFactory));
*/
export interface ILogEventFactory {
} |
@HamedFathi just looked into this and I believe this needs to be I found that works for me and displays properly in VS code. |
Although, I prefer an escape character to a unicode value! just like my sample because It is more beautiful and readable but your suggestion is so good. Thanks. |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@HamedFathi and @RyanCavanaugh, I don’t see this working as intended. |
@Frikki it's not working for me anymore either in VS code 1.41.1, but I'm pretty sure it did before. I found it only works if I put that code in code blocks now. Might be worth it to open an issue in the vscode repo, but I'm not 100% sure what the expected behaviour is. |
@dsherret Thanks for following up on this. I would expect that it should be possible to type |
@dsherret @Frikki : I'm having the same problem but i'm not able to get the
renders as:
|
Sorry for the +1, but this still seems to be an issue. I'm running in to it trying to add common custom html5 element code with Typescript. Take the following example
As I see it right now, this forces developers to choose between two options:
What I've tried: result
|
This is highly unreadable in the source comment. |
In case anyone missed it, #47679 is open and hopefully will finally provide a solution. |
Ah, god when will this be fixed? |
TypeScript Version: 3.7.2
Code
I want to get JSDoc tags, TS compiler detects
@singleton
as a tag but it is not. It is a decorator in the@example
block.Expected behavior:
Ignore decorators inside the
@example
block of JSDoc.Actual behavior:
returns decorator as a tag!
The text was updated successfully, but these errors were encountered: