Skip to content

(bug) Handle at-sign in code block of doc comments. #128543

@infacto

Description

@infacto

Ref. #118977 Please see this issue. It's not fixed. It is marked as duplicate of microsoft/TypeScript#38922. And should have been fixed by microsoft/TypeScript#42364. But it is not fixed. Or am I missing something?

/**
 * The best decorator ever made.
 * 
 * @todo Fix the "@" bug in code block.
 * 
 * @example
 *
 * ```ts
 * class MyComponent {
 *   @SomeDecorator() myValue = 42; // <- This is the problem line.
 * }
 * ```
 */

 export function SomeDecorator() {}

image

The parser detects the at-sign as doc comment tag. But it's a part of the code. So we should ignore the code block.

Version: 1.58.0 (user setup)
Commit: 2d23c42a936db1c7b3b06f918cde29561cc47cd6
Date: 2021-07-08T06:54:55.083Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042

Workaround. Avoid @ sign. For example:

image

But this sucks. But you see what format is expected.

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions