{"record":{"id":"0a1578bc01f3136b","repo":"Automattic/harper","slug":"workspacedict-path-must-be-a-string","errorCode":null,"errorMessage":"workspaceDict path must be a string.","messagePattern":"workspaceDict path must be a string\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"harper-ls/src/config.rs","lineNumber":123,"sourceCode":"            if !path.is_empty() {\n                base.user_dict_path = path.try_resolve_in(workspace_root)?.to_path_buf();\n            }\n        }\n\n        if let Some(v) = value.get(\"fileDictPath\") {\n            if !v.is_string() {\n                bail!(\"fileDict path must be a string.\");\n            }\n\n            let path = v.as_str().unwrap();\n            if !path.is_empty() {\n                base.file_dict_path = path.try_resolve_in(workspace_root)?.to_path_buf();\n            }\n        }\n\n        if let Some(v) = value.get(\"workspaceDictPath\") {\n            if !v.is_string() {\n                bail!(\"workspaceDict path must be a string.\");\n            }\n            let path = v.as_str().unwrap();\n            if !path.is_empty() {\n                base.workspace_dict_path = path.try_resolve_in(workspace_root)?.to_path_buf();\n            }\n        } else {\n            // Resolve the default path in the project root\n            base.workspace_dict_path = base\n                .workspace_dict_path\n                .try_resolve_in(workspace_root)?\n                .to_path_buf();\n        }\n\n        if let Some(v) = value.get(\"ignoredLintsPath\") {\n            if !v.is_string() {\n                bail!(\"ignoredLintsPath path must be a string.\");\n            }\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/Automattic/harper/blob/5fe7d5ab76492d83f3ecdbc3f1da83c75dcb6f83/harper-ls/src/config.rs#L105-L141","documentation":"Same validation pattern as fileDictPath: when `workspaceDictPath` appears in the LSP config value, `from_lsp_config` requires it to be a JSON string because it is resolved into a workspace-relative filesystem path. Non-string values abort configuration parsing.","triggerScenarios":"Passing `workspaceDictPath` as a non-string in initializationOptions or DidChangeConfiguration, e.g. a boolean, number, array, or explicit `null`.","commonSituations":"Users hand-editing Neovim/VS Code settings and dropping quotes around a path, or migration scripts converting old boolean-toggled settings into the new path-based key with the wrong type.","solutions":["Change `workspaceDictPath` to a string path or delete the key to use the default.","Ensure the value is not null; omit the key instead of setting it to null.","Validate the settings JSON with a JSON schema/linter before sending it to the language server."],"exampleFix":"// before\n{ \"workspaceDictPath\": true }\n// after\n{ \"workspaceDictPath\": \"./workspace-dict.txt\" }","handlingStrategy":"validation","validationCode":"if ('workspaceDictPath' in cfg && typeof cfg.workspaceDictPath !== 'string') {\n  throw new TypeError(`workspaceDictPath must be a string, got ${typeof cfg.workspaceDictPath}`);\n}","typeGuard":"function isWorkspaceDictPathOk(cfg) {\n  return !('workspaceDictPath' in cfg) || typeof cfg.workspaceDictPath === 'string';\n}","tryCatchPattern":null,"preventionTips":["Never quote booleans or leave paths unquoted in config","Validate generated configs against the harper-ls settings schema","Omit the key rather than sending null to disable a path option"],"tags":["lsp","config","type-mismatch","rust"],"backgroundTag":"config-type-mismatch","analyzedSha":"5fe7d5ab76492d83f3ecdbc3f1da83c75dcb6f83","analyzedAt":"2026-09-06T11:34:38.610Z","contentChangedAt":"2026-09-06T11:34:38.610Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}