Skip to content
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

Support JSDoc @link tags #119357

Closed
mjbvz opened this issue Mar 19, 2021 · 4 comments · Fixed by #119358
Closed

Support JSDoc @link tags #119357

mjbvz opened this issue Mar 19, 2021 · 4 comments · Fixed by #119358
Assignees
Labels
feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Mar 19, 2021

Tracks the VS Code side of microsoft/TypeScript#35524

This would include supporting {@link} tags in hovers, completions, and quick info

@mjbvz mjbvz added typescript Typescript support issues javascript JavaScript support issues labels Mar 19, 2021
@mjbvz mjbvz added this to the April 2021 milestone Mar 19, 2021
@mjbvz mjbvz self-assigned this Mar 19, 2021
@mjbvz mjbvz added the feature-request Request for new features or functionality label Mar 19, 2021
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 19, 2021
Fixes microsoft#119357
Fixes microsoft#89966

In order to implement this, I also added API that lets markdown strings allow just a subset of command uris. This is required because we have to use a command to implement the links, but do not want to allow just any command to be run
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 19, 2021
Fixes microsoft#119357
Fixes microsoft#89966

In order to implement this, I also added API that lets markdown strings allow just a subset of command uris. This is required because we have to use a command to implement the links, but do not want to allow just any command to be run
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 19, 2021
Fixes microsoft#119357
Fixes microsoft#89966

In order to implement this, I also added API that lets markdown strings allow just a subset of command uris. This is required because we have to use a command to implement the links, but do not want to allow just any command to be run
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 19, 2021
Fixes microsoft#119357
Fixes microsoft#89966

In order to implement this, I also added API that lets markdown strings allow just a subset of command uris. This is required because we have to use a command to implement the links, but do not want to allow just any command to be run
mjbvz added a commit to mjbvz/vscode that referenced this issue Mar 25, 2021
mjbvz added a commit that referenced this issue Mar 29, 2021
* Add support for JSDoc @link tags

Fixes #119357

* Fix unresolved links not rendering
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Apr 27, 2021
@mjbvz
Copy link
Collaborator Author

mjbvz commented Apr 27, 2021

For verification:

  1. make sure you are using TypeScript@next in your workspace: https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next

  2. Try creating a few simple js functions/classes and using {@link symbolName} in jsdoc comments to reference them. Confirm this produces clickable links in: intellisense, parameter hints, and hovers

@jrieken
Copy link
Member

jrieken commented Apr 28, 2021

Using TS 4.3.0-dev.202104017 and adding adding links in vscode.proposed.d.ts but I don't get this to work... Only http-links seem to work, this is my sample

/**
		 * An array of language identifiers that are supported by this
		 * controller. Any language identifier from {@link NotebookController} [`getLanguages`](#languages.getLanguages)
		 * is possible. When falsy all languages are supported.
		 *
		 * {@link http://www.sne.ch }
		 * {@link viewType }
		 * {@link vscode.notebook }
		 *
		 * Samples:
		 * ```js
		 * // support JavaScript and TypeScript
		 * myController.supportedLanguages = ['javascript', 'typescript']
		 *
		 * // support all languages
		 * myController.supportedLanguages = undefined; // falsy
		 * myController.supportedLanguages = []; // falsy
		 * ```
		 */
		supportedLanguages?: string[];

@mjbvz
Copy link
Collaborator Author

mjbvz commented Apr 28, 2021

Thanks @jrieken. This is a TS bug: microsoft/TypeScript#43868

Let me know if you come across any other cases that do not work with this feature. To verify basic @link support, you can use:

class Foo {
    /** {@link Foo} */
    bar(): void {}
}

@connor4312
Copy link
Member

Super cool, found one annoying bug but this'll make life a lot easier.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@jrieken @connor4312 @mjbvz and others