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

Syntax highlighting can not resolve @throws of tsdoc #58599

Open
nabe1653 opened this issue May 21, 2024 · 3 comments
Open

Syntax highlighting can not resolve @throws of tsdoc #58599

nabe1653 opened this issue May 21, 2024 · 3 comments
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Help Wanted You can do this
Milestone

Comments

@nabe1653
Copy link

nabe1653 commented May 21, 2024

Type: Bug

Syntax highlighting for typescript has problem for the function that has @throws .

TSDoc used @throws {@link IsbnSyntaxError} format but VSCode shows broken lint text with break-lines like below:

image

// from tsdoc sample: https://tsdoc.org/pages/tags/throws/
type Book = any;

/**
 * @throws {@link IsbnSyntaxError}
 * This exception is thrown if the input is not a valid ISBN number.
 */
function fetchBookByIsbn(isbnCode: string): Book {}

I thought vscode does not support tsdoc and using jsdoc but jsdoc does not shows correct info too. (this may be related with: microsoft/vscode#135417 )

I expected it shows a link for the Type, at least shows as simple text without break-line.

I may have to report this on other project (TmLanguage? https://github.com/microsoft/TypeScript-TmLanguage/issues) but I did here from VSCode reporter anyway.

VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (6 x 3000)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.78GB (11.72GB free)
Process Argv --disable-extensions --crash-reporter-id ca2a1b94-1896-42fa-87dc-e58738a43fa3
Screen Reader no
VM 0%
Extensions disabled
@nabe1653 nabe1653 changed the title Syntax highlighting can not show @throws of tsdoc Syntax highlighting can not resolve @throws of tsdoc May 21, 2024
@mjbvz mjbvz transferred this issue from microsoft/vscode May 21, 2024
@mjbvz mjbvz removed their assignment May 21, 2024
@nabe1653
Copy link
Author

I used vscode's report feature but now I noticed issued on typescript repo.
VSCode created this ticket automatically without my chooing (I didn't select typescript name).

If this should be reported on vscode repo, so sorry, I will close this and copy this there.

@MartinJohns
Copy link
Contributor

I used vscode's report feature but now I noticed issued on typescript repo.

The issue was transferred to the TypeScript repo by mjbvz.

According to #49891 this should work if you drop the @link.

@nabe1653
Copy link
Author

Thank you for your replying and sorry about taking your time.

I don't know about correct English word so used syntax-highlighting name but I'd like to say about the link in hover-info.

I tried to drop @link then I got below situation:

  1. {@link Class} that in description part has a link on both code and hover-info.
    In my understanding, vscode has a link on both. I expected this working for type part too.
    image
    image

  2. [JSDoc] @throws {Class} has a link on code but not in hover.
    image
    image

  3. [TSDoc] @throws {@link Class} does not have a link on both and hover has broken text.
    image
    (above {@link IsbnSyntaxError} is green color like 2nd too but does not have a link)
    image

Therefore I wished 2 points:

  1. TSDoc format shows not broken text at least
  2. JSDoc or TSDoc format have a link on hover too

I wished hover-info has correct link to read ErrorClass info at the function is called as same as @link on description part.
And I can use jsdoc format but I wish to support tsdoc style too for ts code if possible.

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: JSDoc Relates to JSDoc parsing and type generation labels Jun 17, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants