Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
docs: Improve language server configuration dotted/nested notation example (#19608)
Peter Trippc292bdd2cab1
diff --git a/docs/src/configuring-languages.md b/docs/src/configuring-languages.mdindex fc6de9efeab..3b9e72a08bc 100644--- a/docs/src/configuring-languages.md+++ b/docs/src/configuring-languages.md@@ -151,28 +151,30 @@ Many language servers accept custom configuration options. You can set these inThis example configures the Rust Analyzer to use Clippy for additional linting when saving files.+#### Nested objects+When configuring language server options in Zed, it's important to use nested objects rather than dot-delimited strings. This is particularly relevant when working with more complex configurations. Let's look at a real-world example using the TypeScript language server:Suppose you want to configure the following settings for TypeScript:- Enable strict null checks- Set the target ECMAScript version to ES2020-- Configure import organization preferencesHere's how you would structure these settings in Zed's `settings.json`:-Here's how you might incorrectly attempt to set these options using dot notation:-```json"lsp": {"typescript-language-server": {"initialization_options": {- // This is not supported:- // "preferences.strictNullChecks": true,- // You express it like this:+ // These are not supported (VSCode dotted style):+ // "preferences.strictNullChecks": true,+ // "preferences.target": "ES2020"+ //+ // These is correct (nested notation):"preferences": {- "strictNullChecks": true- }+ "strictNullChecks": true,+ "target": "ES2020"+ },}}}