Skip to content

docs: move filename comments back to the top of code examples - #650

Merged
cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/docs-filename-comments
Nov 2, 2026
Merged

cpojer merged 1 commit into
voidzero-dev:mainfrom
morinokami:fix/docs-filename-comments

Conversation

@morinokami

Copy link
Copy Markdown
Contributor

Since 51ea046, vp fmt also formats code blocks in Markdown. Its import sorting moves a comment along with the import that follows it, so filename comments such as // vite.config.ts ended up between imports in 29 places across 11 pages.

This moves each comment back to directly before the first import of its block. The imports are already sorted, so vp fmt keeps the comments there.

Before:

import { voidMarkdown } from '@void/md/plugin';
import { voidReact } from '@void/react/plugin';
// vite.config.ts
import { defineConfig } from 'vite';
import { voidPlugin } from 'void';

After:

// vite.config.ts
import { voidMarkdown } from '@void/md/plugin';
import { voidReact } from '@void/react/plugin';
import { defineConfig } from 'vite';
import { voidPlugin } from 'void';

Since 51ea046, `vp fmt` also formats code blocks in Markdown files.
Import sorting treats a comment as part of the import that follows it,
so when that import was no longer sorted first, the filename comment
that opened the example moved down with it.

Move the 29 displaced comments back to directly before the first import
of their block. The imports are already sorted, so `vp fmt` leaves the
comments in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8F8maQyB5pkE9PF6GPUae

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@cpojer
cpojer merged commit 1b1fb8c into voidzero-dev:main Nov 2, 2026
2 checks passed
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.

2 participants