Skip to content

fix: keep the Marko prettier plugin under a project prettier config - #603

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-prettier-marko-async-ulp3vg-hermetic-vscode-tests
Sep 23, 2026
Merged

DylanPiercey merged 1 commit into
mainfrom
dpiercey-ws-prettier-marko-async-ulp3vg-hermetic-vscode-tests

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

The formatter spread the project's resolved prettier config over its own options, so any config with plugins (tailwind, packagejson, ...) replaced the Marko plugin: "Format Document" failed with Couldn't resolve parser "marko", and code-action fixes silently fell back to the compiler's unformatted reprint, which the code-action snapshots had recorded (eg <script >). Formatting now keeps the Marko plugin, resolves the config's plugins from the config file rather than the server's working directory, and skips one that cannot be loaded. The code actions share the same helper, and a new test formats against temp projects with a project-only plugin and a missing one.

The vscode tests also create their project inside the repo instead of the system temp dir, where a node_modules above it could supply a different marko (a Marko 6 there made the definition test fail, since it does not treat components/ as a tag directory).

🤖 Generated with Claude Code

The formatter spread the project's resolved prettier config over its own
options, so a config with `plugins` replaced the Marko plugin: "Format
Document" failed with `Couldn't resolve parser "marko"`, and code-action
fixes fell back to the compiler's unformatted reprint, which the code-action
snapshots had recorded. The Marko plugin is now always kept, the config's
plugins are resolved from the config file rather than the server's working
directory, and one that cannot be loaded is skipped.

The vscode tests also create their project inside the repo, so it resolves
this repo's `marko` rather than whatever a `node_modules` above the system
temp dir provides, with its own empty prettier config.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5a154b7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@marko/language-server Patch
marko-vscode Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@DylanPiercey
DylanPiercey merged commit e4cd501 into main Sep 23, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 23, 2026
@DylanPiercey
DylanPiercey deleted the dpiercey-ws-prettier-marko-async-ulp3vg-hermetic-vscode-tests branch September 23, 2026 18:02
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Oct 2, 2026
@DylanPiercey DylanPiercey self-assigned this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant