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

feat(core): implement workspace plugin loading #5160

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Feb 19, 2025

Summary

Implements the last remaining part of plugin loading for the 2.0 release: Most of it was already done, but plugins were not yet actually loaded by the workspace server. This is now done.

Test Plan

Test case added.

@arendjr arendjr requested review from a team February 19, 2025 17:34
@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS labels Feb 19, 2025
@arendjr arendjr force-pushed the plugin-loading-in-workplace branch from d09de82 to f52f06b Compare February 19, 2025 19:08
@arendjr arendjr force-pushed the plugin-loading-in-workplace branch from d01bdf7 to 0e97636 Compare February 20, 2025 09:15
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

I believe the LSP DX is missing. If the configuration has errors, we will notify the client with a message saying that only parsing will work until the configuration is fixed.

We should do the same if plugins couldn't be loaded or have errors. Ideally the message should be different, and mention that plugins are broken. Plus, we should print the diagnostics emitted by merge_with_configuration in the LSP, possibly using the error! tracing log.

Comment on lines 811 to 813
for diagnostic in result.diagnostics {
console.log(markup! {{PrintDiagnostic::simple(&diagnostic)}});
}
Copy link
Member

Choose a reason for hiding this comment

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

Diagnostic errors should block the CLI. If a plugin is broken or can't be loaded, we risk running operations on files with something the user didn't want to. We already do this if the configuration has errors; we should do the same for plugins.

Comment on lines 94 to 95
/// Normalizes the given `path` without requiring filesystem access.
fn normalize_path(path: &Utf8Path) -> Utf8PathBuf {
Copy link
Member

Choose a reason for hiding this comment

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

The meaning of the term "normalize" varies greatly by context (normalize a path VS normalise a URL). We should document precisely what this normalisation does to the paths.

@arendjr
Copy link
Contributor Author

arendjr commented Feb 20, 2025

Thanks! If you don't mind I'll do the LSP DX in a separate PR, it sounds like that could be still a bit of work.

Copy link

codspeed-hq bot commented Feb 20, 2025

CodSpeed Performance Report

Merging #5160 will not alter performance

Comparing arendjr:plugin-loading-in-workplace (0e97636) with main (d739883)

Summary

✅ 94 untouched benchmarks

@arendjr arendjr merged commit a7ebbf0 into biomejs:main Feb 20, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI A-Linter Area: linter A-Project Area: project A-Tooling Area: internal tools L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants