fix(lsp): fmt.configPath empty string handling#17425
Conversation
You're right, I misunderstood the issue. I've reverted the rename and instead added empty string handling to Changes in commit 81803f9:
|
|
@copilot fix the CI lint errors |
There was a problem hiding this comment.
Pull request overview
This PR fixes the handling of empty string values in the fmt.configPath setting for the formatter service, mirroring the fix made for the linter in PR #17415. When VS Code's settings UI auto-generates "fmt.configPath": "", the formatter now treats this as if no config path was specified and falls back to searching for default config files (.oxfmtrc.json and .oxfmtrc.jsonc) instead of failing to initialize.
- Applied empty string filtering using
.filter(|s| !s.is_empty())in both config search and file watcher pattern generation - Added comprehensive tests to verify empty string handling in both formatter options and watcher patterns
- Fixed clippy lint by using
String::new()instead of"".to_string()
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_language_server/src/formatter/server_formatter.rs | Added `.filter( |
| crates/oxc_language_server/src/formatter/options.rs | Added test to verify that empty string config paths are properly parsed and stored as Some(String::new()) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
> This PR fixes the handling of empty string values in the fmt.configPath setting for the formatter service, mirroring the fix made for the linter in PR #17415. When VS Code's settings UI auto-generates "fmt.configPath": "", the formatter now treats this as if no config path was specified and falls back to searching for default config files (.oxfmtrc.json and .oxfmtrc.jsonc) instead of failing to initialize.
be7afc5 to
786a505
Compare
Uh oh!
There was an error while loading. Please reload this page.