-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Visual Studio: Hyperlink @see to referenced type #5802
Comments
+1 |
The this does not work /** Creates an instance of @see foo.bar */
interface foo {
} But this works /**
* Creates an instance of
* @see foo.bar
*/
interface foo {
} I'm not sure whether you see this as a bug, but it's certainly surprising behaviour. I'm using Also # 2 you seem to have something that looks like Code Lens (the Also # 3 I need to hold down the control key for the hyperlink to appear. Thanks |
@NoelAbrahams I'm pretty sure that JSDoc tags are only allowed at the beginning of the line. There are also inline tags like You probably want to write it like /** Creates an instance of {@link foo.bar} */
interface foo { } Typedoc already supports this syntax. Edit: Even the Github code highlighting recognizes tags only at the beginning of the line or in braces. |
@phaux thanks for looking that up. I looked up what appears to be the official documentation and there is no clear definition of whether The fault is in the specification, for lack of clarity, and implementers appear to have decided on not supporting inline |
@NoelAbrahams As you noted, jsdoc.app really only gives examples of one nested tag -- TS mostly supports inline tags, but the implementation is quirky since it's best-effort, not really a committed feature. Specifically, an inline tag works if the line starts with a non-inline tag, or is a line following such a line:
or
This is all down to the state machine we use for parsing, so it could be improved to also support
|
@sandersn Thanks for your PR, but it seems that currently the ts-sever in VS Code doesn't support references unless a comment is at the begin of a block / declaration sentence. I tried such usages: // this works
if (foo) {
/** satisfy {@link ConditionsIfFoo} */
str = getBar()
}
// this doesn't work
if (foo) { /** satisfy {@link ConditionsIfFoo} */
str = getBar()
}
// this doesn't work
if (foo)
{
}
/** all the below won't satisfy {@link ConditionsIfFoo} */
else if (1) {
} else if (2) {
} else {
} While highlighting works well for all the 3 cases. |
@gdh1995 can you open a new issue? That's a missing feature that needs a detailed proposal. Currently jsdoc only works when attached to a declaration of some kind. The exceptions are |
Sorry I didn't know a hint would require so many details. I'm unable to give such a proposal, so let me forget it. I'll update my code to try to make tsserver happy. |
Hi,
In the following
it will be useful if the text referenced by @see (i.e.
foo.Bar
) is hyperlinked to interfaceBar
infile A
.The text was updated successfully, but these errors were encountered: