-
-
Notifications
You must be signed in to change notification settings - Fork 717
refactor(language_server): split ServerFormatter creation with *Builder pattern
#15283
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
refactor(language_server): split ServerFormatter creation with *Builder pattern
#15283
Conversation
ServerFormatter creation with *Builder patternServerFormatter creation with *Builder pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ServerFormatter instantiation by introducing a builder pattern. The ServerFormatter::new() method now only accepts FormatOptions instead of root_uri and LSPFormatOptions, with a new ServerFormatterBuilder handling the configuration file resolution logic.
Key changes:
- Introduced
ServerFormatterBuilderto separate configuration loading from formatter instantiation - Modified
ServerFormatter::new()to acceptFormatOptionsdirectly instead of resolving configuration internally - Updated all call sites to use the builder pattern and adjust parameter passing (by value instead of by reference)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_language_server/src/formatter/server_formatter.rs | Added ServerFormatterBuilder struct and moved configuration resolution methods from ServerFormatter to the builder |
| crates/oxc_language_server/src/worker.rs | Updated all call sites to use ServerFormatterBuilder and changed parameter passing from references to owned values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
03afd96 to
4c70dba
Compare
58be109 to
1e77275
Compare
Merge activity
|
1e77275 to
06bbb5d
Compare
4c70dba to
04f5315
Compare
06bbb5d to
5f81e63
Compare
04f5315 to
5abbd3e
Compare
5f81e63 to
55222ab
Compare
5abbd3e to
a2d78e4
Compare

No description provided.