Skip to content

JSDoc improvements - #84

Merged
nstepien merged 1 commit into
mainfrom
jsdoc-vscode-hovers
Sep 1, 2026
Merged

nstepien merged 1 commit into
mainfrom
jsdoc-vscode-hovers

Conversation

@nstepien

@nstepien nstepien commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Reviews all the JSDoc in the repo for how it actually renders in a VS Code hover, rather than for how it reads in the source.

Hovers are markdown, and JSDoc tags are reformatted before rendering — by the TypeScript extension for the bundled compiler, and server-side by the native preview (tsgo). Both were checked by driving the tsgo LSP server directly and by running the bundled TypeScript through the extension's own tag formatting.

Fixes

  • The css hover did not render. Its @example started with the prose input: before the fence, and tsgo passes an example through as markdown only when it starts with a fence — otherwise it wraps the whole example in one literal code block, ```js markers and all. Every example now starts with a fenced block.
  • The regex @default values displayed the wrong pattern. tsgo renders the value as inline markdown, so @default /\.[cm]?[jt]sx?$/ lost its backslashes and showed /.[cm]?[jt]sx?$/. The values moved into code spans, which keeps them intact.
  • Captions moved to the line after @example. Text on the tag line moves the comment margin to that column, which strips the indentation from every following line — nested example code came out flush-left in both engines.
  • Each code block gets its own captioned @example. Rendered code blocks have no background and only an 8px margin, so the JS and CSS halves of the build output read as one continuous block.

Tags

css had no summary at all, only an example — that summary is what autocomplete and the first hover line show. ecij() had no documentation at all, despite being the symbol users hover in their Vite or Rolldown config. Both now have a summary, @returns and @see; css documents the runtime throw with @throws, and ecij documents its argument with @param.

Configuration gains an interface-level doc with a {@link ecij} cross-link, and each member drops the "Can be a string, RegExp, or array" line — the hover already prints the type directly above the description. Four line comments (the Scope members and the two module caches) became JSDoc so they show up on hover at all.

README.md duplicates the Configuration interface verbatim and is updated to match.

Checks

format:check, typecheck, build and all 10 tests pass. The .d.ts build preserves the new comments intact.

🤖 Generated with Claude Code

The hover for `css` did not render: its `@example` started with the prose
`input:` before the fence, and tsgo only passes an example through as
markdown when it starts with a fence, otherwise it wraps the whole example
in one literal code block. Start every example with a fenced block, and give
each block its own captioned `@example` — rendered code blocks have no
background and only an 8px gap, so two fences in one example read as a
single block.

`@default` values move into code spans. tsgo renders the value as inline
markdown, which ate the backslashes of the two regex defaults and displayed
a different pattern than the one documented.

Captions go on the line after `@example`, never on the tag line: text on the
tag line moves the comment margin to that column, which strips the
indentation from every following line.

`css` had no summary, only an example, and `ecij` had no documentation at
all despite being what users hover in their config. Both now carry a
summary, `@returns` and `@see`, plus `@throws` on `css` for the runtime
throw and `@param` on `ecij`. The `Configuration` members drop the line
restating the type, which the hover already shows above the description.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 5619638d-b39f-4818-a59b-687c8bb4de92


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nstepien nstepien changed the title Optimize the JSDoc for VS Code hovers JSDoc improvements Sep 1, 2026
@nstepien
nstepien merged commit 0b476ee into main Sep 1, 2026
5 checks passed
@nstepien
nstepien deleted the jsdoc-vscode-hovers branch September 1, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant