Skip to content

formatter: config not found when using vs workspaces #97

@Miodec

Description

@Miodec

(This is not an issue if the config path is not specified)

When trying to set a config file for the formatter when using a workspace, oxfmt is reverting to default config (file is located in workspace root):

{
  "folders": [
    {
      "name": "root",
      "path": "./",
    },
    {
      "name": "backend",
      "path": "backend",
    },
    {
      "name": "frontend",
      "path": "frontend",
    },
    {
      "name": "packages",
      "path": "packages",
    },
  ],
...
"oxc.fmt.configPath": ".oxfmtrc.json",
...
2026-02-26 16:04:32.154 [info] �[2m2026-02-26T15:04:32.154510Z�[0m �[32m INFO�[0m tokio-runtime-worker �[2mtower_lsp_server::service::layers�[0m�[2m:�[0m shutdown request received, shutting down

2026-02-26 16:04:32.155 [info] �[2m2026-02-26T15:04:32.154899Z�[0m �[32m INFO�[0m tokio-runtime-worker �[2mtower_lsp_server::service::layers�[0m�[2m:�[0m exit notification received, stopping

2026-02-26 16:04:32.199 [info] �[2m2026-02-26T15:04:32.199353Z�[0m �[32m INFO�[0m tokio-runtime-worker �[2moxc_language_server::backend�[0m�[2m:�[0m initialize: Some([WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/Users/jack/Code/monkeytype", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true), "fmt.configPath": String(".oxfmtrc.json")} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/Users/jack/Code/monkeytype/backend", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true), "fmt.configPath": String(".oxfmtrc.json")} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/Users/jack/Code/monkeytype/frontend", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true), "fmt.configPath": String(".oxfmtrc.json")} }, WorkspaceOption { workspace_uri: Uri(Uri { scheme: "file", authority: Some(Authority { userinfo: None, host: "", host_parsed: RegName(""), port: None }), path: "/Users/jack/Code/monkeytype/packages", query: None, fragment: None }), options: Object {"fmt.experimental": Bool(true), "fmt.configPath": String(".oxfmtrc.json")} }])
�[2m2026-02-26T15:04:32.199379Z�[0m �[32m INFO�[0m tokio-runtime-worker �[2moxc_language_server::backend�[0m�[2m:�[0m oxfmt version: 0.35.0

2026-02-26 16:04:32.203 [info] �[2m2026-02-26T15:04:32.203200Z�[0m �[33m WARN�[0m tokio-runtime-worker �[2moxfmt::lsp::server_formatter�[0m�[2m:�[0m Failed to build config resolver: Failed to read /Users/jack/Code/monkeytype/backend/.oxfmtrc.json: File not found, falling back to default config

2026-02-26 16:04:32.204 [info] �[2m2026-02-26T15:04:32.204449Z�[0m �[33m WARN�[0m tokio-runtime-worker �[2moxfmt::lsp::server_formatter�[0m�[2m:�[0m Failed to build config resolver: Failed to read /Users/jack/Code/monkeytype/frontend/.oxfmtrc.json: File not found, falling back to default config

2026-02-26 16:04:32.205 [info] �[2m2026-02-26T15:04:32.205172Z�[0m �[33m WARN�[0m tokio-runtime-worker �[2moxfmt::lsp::server_formatter�[0m�[2m:�[0m Failed to build config resolver: Failed to read /Users/jack/Code/monkeytype/packages/.oxfmtrc.json: File not found, falling back to default config

2026-02-26 16:04:32.220 [info] [Error - 4:04:32 PM] Server process exited with code 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions