docs: Validate JSON snippets (settings, keymap, tasks, etc) (#40043)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -11,7 +11,7 @@ Support for Ansible in Zed is provided via a community-maintained [Ansible exten
|
||||
|
||||
To avoid mishandling non-Ansible YAML files, the Ansible Language is not associated with any file extensions by default. To change this behavior you can add a `"file_types"` section to Zed settings inside your project (`.zed/settings.json`) or your Zed user settings (`~/.config/zed/settings.json`) to match your folder/naming conventions. For example:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"file_types": {
|
||||
"Ansible": [
|
||||
"**.ansible.yml",
|
||||
@@ -50,7 +50,7 @@ If your inventory file is in the YAML format, you can either:
|
||||
|
||||
- Or configure the yaml language server settings to set this schema for all your inventory files, that match your inventory pattern, under your Zed settings ([ref](https://zed.dev/docs/languages/yaml)):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"yaml-language-server": {
|
||||
"settings": {
|
||||
@@ -71,7 +71,7 @@ If your inventory file is in the YAML format, you can either:
|
||||
|
||||
By default, the following default config is passed to the Ansible language server. It conveniently mirrors the defaults set by [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/03bc581e05e81d33808b42b2d7e76d70adb3b595/lua/lspconfig/configs/ansiblels.lua) for the Ansible language server:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"ansible": {
|
||||
"ansible": {
|
||||
@@ -99,7 +99,7 @@ By default, the following default config is passed to the Ansible language serve
|
||||
|
||||
When desired, any of the above default settings can be overridden under the `"lsp"` section of your Zed settings file. For example:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
// Note, the Zed Ansible extension prefixes all settings with `ansible`
|
||||
// so instead of using `ansible.ansible.path` use `ansible.path`.
|
||||
|
||||
@@ -24,7 +24,7 @@ The Biome extension includes support for the following languages:
|
||||
|
||||
By default, the `biome.json` file is required to be in the root of the workspace.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json"
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ CompileFlags:
|
||||
|
||||
By default clang and gcc will recognize `*.C` and `*.H` (uppercase extensions) as C++ and not C and so Zed too follows this convention. If you are working with a C-only project (perhaps one with legacy uppercase pathing like `FILENAME.C`) you can override this behavior by adding this to your settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"file_types": {
|
||||
"C": ["C", "H"]
|
||||
@@ -40,7 +40,7 @@ See [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOpt
|
||||
|
||||
You can trigger formatting via {#kb editor::Format} or the `editor: format` action from the command palette or by adding `format_on_save` to your Zed settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"C": {
|
||||
"format_on_save": "on",
|
||||
@@ -69,7 +69,7 @@ You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build
|
||||
|
||||
### Build and Debug Binary
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug native binary",
|
||||
|
||||
@@ -13,7 +13,7 @@ By default, Zed will try to find a `clangd` in your `$PATH` and try to use that.
|
||||
|
||||
If you want to install a pre-release `clangd` version instead you can instruct Zed to do so by setting `pre_release` to `true` in your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"clangd": {
|
||||
@@ -27,7 +27,7 @@ If you want to install a pre-release `clangd` version instead you can instruct Z
|
||||
|
||||
If you want to disable Zed looking for a `clangd` binary, you can set `ignore_system_version` to `true` in your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"clangd": {
|
||||
@@ -41,7 +41,7 @@ If you want to disable Zed looking for a `clangd` binary, you can set `ignore_sy
|
||||
|
||||
If you want to use a binary in a custom location, you can specify a `path` and optional `arguments`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"clangd": {
|
||||
@@ -60,7 +60,7 @@ This `"path"` has to be an absolute path.
|
||||
|
||||
You can pass any number of arguments to clangd. To see a full set of available options, run `clangd --help` from the command line. For example with `--function-arg-placeholders=0` completions contain only parentheses for function calls, while the default (`--function-arg-placeholders=1`) completions also contain placeholders for method parameters.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"clangd": {
|
||||
@@ -93,7 +93,7 @@ See [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOpt
|
||||
|
||||
You can trigger formatting via {#kb editor::Format} or the `editor: format` action from the command palette or by adding `format_on_save` to your Zed settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"C++": {
|
||||
"format_on_save": "on",
|
||||
@@ -137,7 +137,7 @@ You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build
|
||||
|
||||
### Build and Debug Binary
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug native binary",
|
||||
|
||||
@@ -11,7 +11,7 @@ C# support is available through the [C# extension](https://github.com/zed-extens
|
||||
|
||||
The `OmniSharp` binary can be configured in a Zed settings file with:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"omnisharp": {
|
||||
|
||||
@@ -22,7 +22,7 @@ dart --version
|
||||
|
||||
If you would like to use a specific dart binary or use dart via FVM you can specify the `dart` binary in your Zed settings.jsons file:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"dart": {
|
||||
@@ -39,7 +39,7 @@ If you would like to use a specific dart binary or use dart via FVM you can spec
|
||||
|
||||
Dart by-default uses a very conservative maximum line length (80). If you would like the dart LSP to permit a longer line length when auto-formatting, add the following to your Zed settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"dart": {
|
||||
|
||||
@@ -8,7 +8,7 @@ Deno support is available through the [Deno extension](https://github.com/zed-ex
|
||||
|
||||
To use the Deno Language Server with TypeScript and TSX files, you will likely wish to disable the default language servers and enable deno by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"deno": {
|
||||
@@ -61,7 +61,7 @@ TBD: Deno TypeScript REPL instructions [docs/repl#typescript-deno](../repl.md#ty
|
||||
|
||||
To get completions for `deno.json` or `package.json` you can add the following to your `settings.json`: (More info here https://zed.dev/docs/languages/json)
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"json-language-server": {
|
||||
"settings": {
|
||||
@@ -90,7 +90,7 @@ To get completions for `deno.json` or `package.json` you can add the following t
|
||||
|
||||
To debug deno programs, add this to `.zed/debug.json`
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"adapter": "JavaScript",
|
||||
@@ -110,7 +110,7 @@ To debug deno programs, add this to `.zed/debug.json`
|
||||
|
||||
To run deno tasks like tests from the ui, add this to `.zed/tasks.json`
|
||||
|
||||
```json
|
||||
```json [tasks]
|
||||
[
|
||||
{
|
||||
"label": "deno test",
|
||||
|
||||
@@ -10,7 +10,7 @@ Zed will not attempt to format diff files and has [`remove_trailing_whitespace_o
|
||||
|
||||
Zed will automatically recognize files with `patch` and `diff` extensions as Diff files. To recognize other extensions, add them to `file_types` in your Zed settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"file_types": {
|
||||
"Diff": ["dif"]
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ The Elixir extension offers language server support for `expert`, `elixir-ls`, `
|
||||
|
||||
To switch to `expert`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Elixir": {
|
||||
"language_servers": ["expert", "!elixir-ls", "!next-ls", "!lexical", "..."]
|
||||
@@ -36,7 +36,7 @@ To switch to `expert`, add the following to your `settings.json`:
|
||||
|
||||
To switch to `next-ls`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Elixir": {
|
||||
"language_servers": ["next-ls", "!expert", "!elixir-ls", "!lexical", "..."]
|
||||
@@ -51,7 +51,7 @@ To switch to `next-ls`, add the following to your `settings.json`:
|
||||
|
||||
To switch to `lexical`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Elixir": {
|
||||
"language_servers": ["lexical", "!expert", "!elixir-ls", "!next-ls", "..."]
|
||||
@@ -84,11 +84,12 @@ brew install elixir-ls
|
||||
|
||||
If you prefer to format your code with [Mix](https://hexdocs.pm/mix/Mix.html), use the following snippet in your `settings.json` file to configure it as an external formatter. Formatting will occur on file save.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Elixir": {
|
||||
"format_on_save": {
|
||||
"format_on_save": "on",
|
||||
"formatter": {
|
||||
"external": {
|
||||
"command": "mix",
|
||||
"arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
|
||||
@@ -105,7 +106,7 @@ You can pass additional elixir-ls workspace configuration options via lsp settin
|
||||
|
||||
The following example disables dialyzer:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"elixir-ls": {
|
||||
"settings": {
|
||||
|
||||
@@ -23,7 +23,7 @@ Zed support for Elm requires installation of `elm`, `elm-format`, and `elm-revie
|
||||
|
||||
Elm language server can be configured in your `settings.json`, e.g.:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"elm-language-server": {
|
||||
|
||||
@@ -15,7 +15,7 @@ The Erlang extension offers language server support for `erlang_ls` and `erlang-
|
||||
|
||||
To switch to `erlang-language-platform`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Erlang": {
|
||||
|
||||
@@ -18,7 +18,7 @@ fish_indent --version
|
||||
|
||||
2. Configure Zed to automatically format fish code with `fish_indent`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Fish": {
|
||||
"formatter": {
|
||||
|
||||
@@ -41,7 +41,7 @@ If `gopls` is not found you will likely need to add `export PATH="$PATH:$HOME/go
|
||||
|
||||
Zed sets the following initialization options for inlay hints:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"hints": {
|
||||
"assignVariableTypes": true,
|
||||
"compositeLiteralFields": true,
|
||||
@@ -57,12 +57,12 @@ to make the language server send back inlay hints when Zed has them enabled in t
|
||||
|
||||
Use
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"gopls": {
|
||||
"initialization_options": {
|
||||
"hints": {
|
||||
....
|
||||
// ....
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See bel
|
||||
|
||||
To debug a specific package, you can do so by setting the Delve mode to "debug". In this case "program" should be set to the package name.
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Go (Delve)",
|
||||
@@ -110,7 +110,7 @@ To debug a specific package, you can do so by setting the Delve mode to "debug".
|
||||
To debug the tests for a package, set the Delve mode to "test".
|
||||
The "program" is still the package name, and you can use the "buildFlags" to do things like set tags, and the "args" to set args on the test binary. (See `go help testflags` for more information on doing that).
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Run integration tests",
|
||||
@@ -130,7 +130,7 @@ The "program" is still the package name, and you can use the "buildFlags" to do
|
||||
If you need to build your application with a specific command, you can use the "exec" mode of Delve. In this case "program" should point to an executable,
|
||||
and the "build" command should build that.
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug Prebuilt Unit Tests",
|
||||
@@ -160,7 +160,7 @@ and the "build" command should build that.
|
||||
|
||||
You might find yourself needing to connect to an existing instance of Delve that's not necessarily running on your machine; in such case, you can use `tcp_arguments` to instrument Zed's connection to Delve.
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"adapter": "Delve",
|
||||
@@ -172,7 +172,7 @@ You might find yourself needing to connect to an existing instance of Delve that
|
||||
"request": "launch",
|
||||
"mode": "exec",
|
||||
"stopOnEntry": false,
|
||||
"tcp_connection": { "host": "123.456.789.012", "port": 53412 }
|
||||
"tcp_connection": { "host": "127.0.0.1", "port": 53412 }
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -19,7 +19,7 @@ which haskell-language-server-wrapper
|
||||
|
||||
If you need to configure haskell-language-server (hls) you can add configuration options to your Zed settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"hls": {
|
||||
@@ -37,7 +37,7 @@ See the official [configuring haskell-language-server](https://haskell-language-
|
||||
|
||||
If you would like to use a specific hls binary, or perhaps use [static-ls](https://github.com/josephsumabat/static-ls) as a drop-in replacement instead, you can specify the binary path and arguments:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"hls": {
|
||||
|
||||
@@ -9,7 +9,7 @@ Support for Helm in Zed is provided by the community-maintained [Helm extension]
|
||||
|
||||
Enable Helm language for Helm files by editing your `.zed/settings.json` and adding:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"file_types": {
|
||||
"Helm": [
|
||||
"**/templates/**/*.tpl",
|
||||
|
||||
@@ -7,7 +7,7 @@ HTML support is available through the [HTML extension](https://github.com/zed-in
|
||||
|
||||
This extension is automatically installed, but if you do not want to use it, you can add the following to your settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"auto_install_extensions": {
|
||||
"html": false
|
||||
@@ -21,7 +21,7 @@ By default Zed uses [Prettier](https://prettier.io/) for formatting HTML.
|
||||
|
||||
You can disable `format_on_save` by adding the following to your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"HTML": {
|
||||
"format_on_save": "off",
|
||||
@@ -35,7 +35,7 @@ You can still trigger formatting manually with {#kb editor::Format} or by openin
|
||||
|
||||
To use the `vscode-html-language-server` language server auto-formatting instead of Prettier, add the following to your Zed settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"HTML": {
|
||||
"formatter": "language_server",
|
||||
@@ -45,7 +45,7 @@ To use the `vscode-html-language-server` language server auto-formatting instead
|
||||
|
||||
You can customize various [formatting options](https://code.visualstudio.com/docs/languages/html#_formatting) for `vscode-html-language-server` via your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"vscode-html-language-server": {
|
||||
"settings": {
|
||||
|
||||
@@ -31,7 +31,7 @@ You can add these customizations to your Zed Settings by launching {#action zed:
|
||||
|
||||
### Zed Java Settings
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"jdtls": {
|
||||
@@ -47,7 +47,7 @@ You can add these customizations to your Zed Settings by launching {#action zed:
|
||||
|
||||
By default, zed will look in your `PATH` for a `jdtls` binary, if you wish to specify an explicit binary you can do so via settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"jdtls": {
|
||||
"binary": {
|
||||
@@ -64,7 +64,7 @@ By default, zed will look in your `PATH` for a `jdtls` binary, if you wish to sp
|
||||
|
||||
There are also many more options you can pass directly to the language server, for example:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"jdtls": {
|
||||
|
||||
@@ -15,7 +15,7 @@ See [the configuration docs](../configuring-zed.md) for more information.
|
||||
|
||||
For example, if you have Prettier installed and on your `PATH`, you can use it to format JavaScript files by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"JavaScript": {
|
||||
@@ -45,7 +45,7 @@ Zed uses [tree-sitter/tree-sitter-jsdoc](https://github.com/tree-sitter/tree-sit
|
||||
|
||||
You can configure Zed to format code using `eslint --fix` by running the ESLint code action when formatting:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"JavaScript": {
|
||||
@@ -59,7 +59,7 @@ You can configure Zed to format code using `eslint --fix` by running the ESLint
|
||||
|
||||
You can also only execute a single ESLint rule when using `fixAll`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"JavaScript": {
|
||||
@@ -88,14 +88,12 @@ You can also only execute a single ESLint rule when using `fixAll`:
|
||||
If you **only** want to run ESLint on save, you can configure code actions as
|
||||
the formatter:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"JavaScript": {
|
||||
"formatter": {
|
||||
"code_actions": {
|
||||
"source.fixAll.eslint": true
|
||||
}
|
||||
"code_action": "source.fixAll.eslint"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +104,7 @@ the formatter:
|
||||
|
||||
You can configure ESLint's `nodePath` setting:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"eslint": {
|
||||
@@ -124,7 +122,7 @@ You can configure ESLint's `problems` setting.
|
||||
|
||||
For example, here's how to set `problems.shortenToSingleLine`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"eslint": {
|
||||
@@ -142,7 +140,7 @@ For example, here's how to set `problems.shortenToSingleLine`:
|
||||
|
||||
You can configure ESLint's `rulesCustomizations` setting:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"eslint": {
|
||||
@@ -161,7 +159,7 @@ You can configure ESLint's `rulesCustomizations` setting:
|
||||
|
||||
You can configure ESLint's `workingDirectory` setting:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"eslint": {
|
||||
@@ -191,7 +189,7 @@ If your use-case isn't covered by any of these, you can take full control by add
|
||||
|
||||
### Debug the current file
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"adapter": "JavaScript",
|
||||
@@ -208,7 +206,7 @@ This implicitly runs the current file using `node`.
|
||||
|
||||
### Launch a web app in Chrome
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"adapter": "JavaScript",
|
||||
|
||||
@@ -16,7 +16,7 @@ If you use files with the `*.jsonc` extension when using `Format Document` or ha
|
||||
|
||||
To workaround this behavior you can add the following to your `.prettierrc` configuration file:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"overrides": [
|
||||
{
|
||||
@@ -40,7 +40,7 @@ To specify a schema inline with your JSON files, add a `$schema` top level key l
|
||||
|
||||
For example to for a `.luarc.json` for use with [lua-language-server](https://github.com/LuaLS/lua-language-server/):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.4"
|
||||
@@ -53,7 +53,7 @@ You can alternatively associate JSON Schemas with file paths by via Zed LSP sett
|
||||
|
||||
To
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"json-language-server": {
|
||||
"settings": {
|
||||
|
||||
@@ -11,7 +11,7 @@ Workspace configuration options can be passed to the language server via the `ls
|
||||
|
||||
The following example enables support for resolving [tanka](https://tanka.dev) import paths in `jsonnet-language-server`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"jsonnet-language-server": {
|
||||
|
||||
@@ -20,7 +20,7 @@ under `class Configuration` and initialization_options under `class Initializati
|
||||
The following example changes the JVM target from `default` (which is 1.8) to
|
||||
`17`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"kotlin-language-server": {
|
||||
@@ -40,7 +40,7 @@ The following example changes the JVM target from `default` (which is 1.8) to
|
||||
|
||||
To use a specific java installation, just specify the `JAVA_HOME` environment variable with:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"kotlin-language-server": {
|
||||
|
||||
@@ -9,7 +9,7 @@ Lua support is available through the [Lua extension](https://github.com/zed-exte
|
||||
|
||||
To configure LuaLS you can create a `.luarc.json` file in the root of your workspace.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.4",
|
||||
@@ -55,7 +55,7 @@ cd .. && git clone https://github.com/notpeter/playdate-luacats
|
||||
|
||||
Then in your `.luarc.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.4",
|
||||
@@ -90,7 +90,7 @@ To enable [Inlay Hints](../configuring-languages.md#inlay-hints) for LuaLS in Ze
|
||||
|
||||
1. Add the following to your Zed settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Lua": {
|
||||
"inlay_hints": {
|
||||
@@ -111,7 +111,7 @@ To enable [Inlay Hints](../configuring-languages.md#inlay-hints) for LuaLS in Ze
|
||||
|
||||
To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle](https://github.com/CppCXY/EmmyLuaCodeStyle)) make sure you have `"format.enable": true,` in your .luarc.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"format.enable": true
|
||||
@@ -120,7 +120,7 @@ To enable auto-formatting with your LuaLS (provided by [CppCXY/EmmyLuaCodeStyle]
|
||||
|
||||
Then add the following to your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Lua": {
|
||||
@@ -140,7 +140,7 @@ Alternatively to use [StyLua](https://github.com/JohnnyMorganz/StyLua) for auto-
|
||||
1. Install [StyLua](https://github.com/JohnnyMorganz/StyLua): `brew install stylua` or `cargo install stylua --features lua52,lua53,lua54,luau,luajit` (feel free to remove any Lua versions you don't need).
|
||||
2. Add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Lua": {
|
||||
|
||||
@@ -27,7 +27,7 @@ cargo install stylua --features lua52,lua53,lua54,luau
|
||||
|
||||
Then add the following to your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Luau": {
|
||||
"formatter": {
|
||||
|
||||
@@ -25,7 +25,7 @@ def fib(n):
|
||||
|
||||
Zed supports using Prettier to automatically re-format Markdown documents. You can trigger this manually via the {#action editor::Format} action or via the {#kb editor::Format} keyboard shortcut. Alternately, you can automatically format by enabling [`format_on_save`](../configuring-zed.md#format-on-save) in your settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Markdown": {
|
||||
"format_on_save": "on"
|
||||
@@ -37,7 +37,7 @@ Zed supports using Prettier to automatically re-format Markdown documents. You c
|
||||
|
||||
By default Zed will remove trailing whitespace on save. If you rely on invisible trailing whitespace being converted to `<br />` in Markdown files you can disable this behavior with:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Markdown": {
|
||||
"remove_trailing_whitespace_on_save": false
|
||||
|
||||
@@ -10,7 +10,7 @@ Report issues to: [https://github.com/foxoman/zed-nim/issues](https://github.com
|
||||
|
||||
To use [arnetheduck/nph](https://github.com/arnetheduck/nph) as a formatter, follow the [nph installation instructions](https://github.com/arnetheduck/nph?tab=readme-ov-file#installation) and add this to your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Nim": {
|
||||
"formatter": {
|
||||
|
||||
@@ -31,7 +31,7 @@ which php
|
||||
|
||||
To switch to `intelephense`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"PHP": {
|
||||
@@ -43,7 +43,7 @@ To switch to `intelephense`, add the following to your `settings.json`:
|
||||
|
||||
To use the premium features, you can place your [licence.txt file](https://intelephense.com/faq.html) at `~/intelephense/licence.txt` inside your home directory. Alternatively, you can pass the licence key or a path to a file containing the licence key as an initialization option for the `intelephense` language server. To do this, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"intelephense": {
|
||||
|
||||
@@ -24,7 +24,7 @@ The Zed PowerShell extensions will attempt to download [PowerShell Editor Servic
|
||||
|
||||
If want to use a specific binary, you can specify in your that in your Zed settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"powershell-es": {
|
||||
"binary": {
|
||||
|
||||
@@ -30,7 +30,7 @@ which protols
|
||||
|
||||
## Configuration
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"protobuf-language-server": {
|
||||
"binary": {
|
||||
@@ -62,7 +62,7 @@ ColumnLimit: 120
|
||||
|
||||
Or you can have zed directly invoke `clang-format` by specifying it as a [formatter](https://zed.dev/docs/configuring-zed#formatter) in your settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Proto": {
|
||||
"format_on_save": "on",
|
||||
|
||||
@@ -77,7 +77,7 @@ Other built-in language servers are:
|
||||
|
||||
These are disabled by default, but can be enabled in your settings. For example:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Python": {
|
||||
@@ -123,7 +123,7 @@ For example, in order to:
|
||||
|
||||
You can use the following configuration:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"basedpyright": {
|
||||
@@ -144,7 +144,7 @@ basedpyright reads project-specific configuration from the `pyrightconfig.json`
|
||||
|
||||
Here's an example `pyrightconfig.json` file that configures basedpyright to use the `strict` type-checking mode and not to issue diagnostics for any files in `__pycache__` directories:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"typeCheckingMode": "strict",
|
||||
"ignore": ["**/__pycache__"]
|
||||
@@ -194,7 +194,7 @@ Zed provides the [Ruff](https://docs.astral.sh/ruff/) formatter and linter for P
|
||||
|
||||
You can disable format-on-save for Python files in your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Python": {
|
||||
@@ -206,7 +206,7 @@ You can disable format-on-save for Python files in your `settings.json`:
|
||||
|
||||
Alternatively, you can use the `black` command-line tool for Python formatting, while keeping Ruff enabled for linting:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Python": {
|
||||
@@ -228,7 +228,7 @@ Like basedpyright, Ruff reads options from both Zed's language server settings a
|
||||
|
||||
Here's an example of using language server settings in Zed's `settings.json` to disable all Ruff lints in Zed (while still using Ruff as a formatter):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"ruff": {
|
||||
@@ -277,7 +277,7 @@ For reusable setups, create a `.zed/debug.json` file in your project root. This
|
||||
|
||||
#### Debug Active File
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Python Active File",
|
||||
@@ -309,7 +309,7 @@ requirements.txt
|
||||
|
||||
…the following configuration can be used:
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Python: Flask",
|
||||
|
||||
@@ -72,7 +72,7 @@ You can configure the [R languageserver settings](https://github.com/REditorSupp
|
||||
|
||||
For example to disable Lintr linting and suppress code snippet suggestions (both enabled by default):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"r_language_server": {
|
||||
|
||||
+21
-21
@@ -46,7 +46,7 @@ For all supported Ruby language servers (`solargraph`, `ruby-lsp`, `rubocop`, `s
|
||||
|
||||
You can skip step 1 and force using the system executable by setting `use_bundler` to `false` in your settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"<SERVER_NAME>": {
|
||||
@@ -66,7 +66,7 @@ You can skip step 1 and force using the system executable by setting `use_bundle
|
||||
|
||||
To switch to `ruby-lsp`, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -84,7 +84,7 @@ The Ruby extension also provides support for `rubocop` language server for offen
|
||||
|
||||
To enable it, add the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -96,7 +96,7 @@ To enable it, add the following to your `settings.json`:
|
||||
|
||||
Or, conversely, you can disable `ruby-lsp` and enable `solargraph` and `rubocop` by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -110,7 +110,7 @@ Or, conversely, you can disable `ruby-lsp` and enable `solargraph` and `rubocop`
|
||||
|
||||
Solargraph has formatting and diagnostics disabled by default. We can tell Zed to enable them by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"solargraph": {
|
||||
@@ -131,7 +131,7 @@ Solargraph reads its configuration from a file called `.solargraph.yml` in the r
|
||||
|
||||
You can pass Ruby LSP configuration to `initialization_options`, e.g.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -152,7 +152,7 @@ You can pass Ruby LSP configuration to `initialization_options`, e.g.
|
||||
|
||||
LSP `settings` and `initialization_options` can also be project-specific. For example to use [standardrb/standard](https://github.com/standardrb/standard) as a formatter and linter for a particular project, add this to a `.zed/settings.json` inside your project repo:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"ruby-lsp": {
|
||||
@@ -169,7 +169,7 @@ LSP `settings` and `initialization_options` can also be project-specific. For ex
|
||||
|
||||
Rubocop has unsafe autocorrection disabled by default. We can tell Zed to enable it by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -200,7 +200,7 @@ Rubocop has unsafe autocorrection disabled by default. We can tell Zed to enable
|
||||
|
||||
To enable Sorbet, add `\"sorbet\"` to the `language_servers` list for Ruby in your `settings.json`. You may want to disable other language servers if Sorbet is intended to be your primary LSP, or if you plan to use it alongside another LSP for specific features like type checking.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -224,7 +224,7 @@ For all aspects of installing Sorbet, setting it up in your project, and configu
|
||||
|
||||
To enable Steep, add `\"steep\"` to the `language_servers` list for Ruby in your `settings.json`. You may need to adjust the order or disable other LSPs depending on your desired setup.
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -250,7 +250,7 @@ It's possible to use the [Tailwind CSS Language Server](https://github.com/tailw
|
||||
|
||||
In order to do that, you need to configure the language server so that it knows about where to look for CSS classes in Ruby/ERB files by adding the following to your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"Ruby": {
|
||||
@@ -294,7 +294,7 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z
|
||||
|
||||
### Minitest with Rails
|
||||
|
||||
```json
|
||||
```json [tasks]
|
||||
[
|
||||
{
|
||||
"label": "test $ZED_RELATIVE_FILE -n /$ZED_CUSTOM_RUBY_TEST_NAME/",
|
||||
@@ -315,7 +315,7 @@ To run tests in your Ruby project, you can set up custom tasks in your local `.z
|
||||
|
||||
Plain minitest does not support running tests by line number, only by name, so we need to use `$ZED_CUSTOM_RUBY_TEST_NAME` instead:
|
||||
|
||||
```json
|
||||
```json [tasks]
|
||||
[
|
||||
{
|
||||
"label": "-Itest $ZED_RELATIVE_FILE -n /$ZED_CUSTOM_RUBY_TEST_NAME/",
|
||||
@@ -336,7 +336,7 @@ Plain minitest does not support running tests by line number, only by name, so w
|
||||
|
||||
### RSpec
|
||||
|
||||
```json
|
||||
```json [tasks]
|
||||
[
|
||||
{
|
||||
"label": "test $ZED_RELATIVE_FILE:$ZED_ROW",
|
||||
@@ -358,7 +358,7 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name
|
||||
|
||||
#### Debug a Ruby script
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug current file",
|
||||
@@ -372,7 +372,7 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name
|
||||
|
||||
#### Debug Rails server
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug Rails server",
|
||||
@@ -394,15 +394,15 @@ The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name
|
||||
|
||||
To format ERB templates, you can use the `erb-formatter` formatter. This formatter uses the [`erb-formatter`](https://rubygems.org/gems/erb-formatter) gem to format ERB templates.
|
||||
|
||||
```jsonc
|
||||
```json [settings]
|
||||
{
|
||||
"HTML+ERB": {
|
||||
"formatter": {
|
||||
"external": {
|
||||
"command": "erb-formatter",
|
||||
"arguments": ["--stdin-filename", "{buffer_path}"],
|
||||
},
|
||||
},
|
||||
},
|
||||
"arguments": ["--stdin-filename", "{buffer_path}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
+12
-12
@@ -16,7 +16,7 @@ TBD: Provide explicit examples not just `....`
|
||||
|
||||
The following configuration can be used to change the inlay hint settings for `rust-analyzer` in Rust:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -43,7 +43,7 @@ See [Inlay Hints](https://rust-analyzer.github.io/book/features.html#inlay-hints
|
||||
|
||||
The `rust-analyzer` target directory can be set in `initialization_options`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -67,7 +67,7 @@ By default, Zed will try to find a `rust-analyzer` in your `$PATH` and try to us
|
||||
|
||||
If you want to install pre-release `rust-analyzer` version instead you can instruct Zed to do so by setting `pre_release` to `true` in your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -81,7 +81,7 @@ If you want to install pre-release `rust-analyzer` version instead you can instr
|
||||
|
||||
If you want to disable Zed looking for a `rust-analyzer` binary, you can set `ignore_system_version` to `true` in your `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -95,7 +95,7 @@ If you want to disable Zed looking for a `rust-analyzer` binary, you can set `ig
|
||||
|
||||
If you want to use a binary in a custom location, you can specify a `path` and optional `arguments`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -114,7 +114,7 @@ This `"path"` has to be an absolute path.
|
||||
|
||||
If you want rust-analyzer to provide diagnostics for a target other than your current platform (e.g. for windows when running on macOS) you can use the following Zed lsp settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -139,7 +139,7 @@ rustup target list --installed
|
||||
Zed provides tasks using tree-sitter, but rust-analyzer has an LSP extension method for querying file-related tasks via LSP.
|
||||
This is enabled by default and can be configured as
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"enable_lsp_tasks": true,
|
||||
@@ -191,7 +191,7 @@ Check on save feature is responsible for returning part of the diagnostics based
|
||||
Consider more `rust-analyzer.cargo.` and `rust-analyzer.check.` and `rust-analyzer.diagnostics.` settings from the manual for more fine-grained configuration.
|
||||
Here's a snippet for Zed settings.json (the language server will restart automatically after the `lsp.rust-analyzer` section is edited and saved):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -225,7 +225,7 @@ Here's a snippet for Zed settings.json (the language server will restart automat
|
||||
If you want rust-analyzer to analyze multiple Rust projects in the same folder that are not listed in `[members]` in the Cargo workspace,
|
||||
you can list them in `linkedProjects` in the local project settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -241,7 +241,7 @@ you can list them in `linkedProjects` in the local project settings:
|
||||
|
||||
There's a way to get custom completion items from rust-analyzer, that will transform the code according to the snippet body:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
@@ -300,7 +300,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See the
|
||||
|
||||
### Build binary then debug
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Build & Debug native binary",
|
||||
@@ -321,7 +321,7 @@ For more control, you can add debug configurations to `.zed/debug.json`. See the
|
||||
|
||||
When you use `cargo build` or `cargo test` as the build command, Zed can infer the path to the output binary.
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Build & Debug native binary",
|
||||
|
||||
@@ -8,7 +8,7 @@ Shell Scripts (bash, zsh, dash, sh) are supported natively by Zed.
|
||||
|
||||
You can configure various settings for Shell Scripts in your Zed User Settings (`~/.config/zed/settings.json`) or Zed Project Settings (`.zed/settings.json`):
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Shell Script": {
|
||||
"tab_size": 2,
|
||||
@@ -41,7 +41,7 @@ shfmt --version
|
||||
|
||||
3. Configure Zed to automatically format Shell Scripts with `shfmt` on save:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"Shell Script": {
|
||||
"format_on_save": "on",
|
||||
|
||||
@@ -23,7 +23,7 @@ sql-formatter --version
|
||||
|
||||
3. Configure Zed to automatically format SQL with `sql-formatter`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"SQL": {
|
||||
"formatter": {
|
||||
@@ -44,7 +44,7 @@ You can add this to Zed project settings (`.zed/settings.json`) or via your Zed
|
||||
|
||||
Sql-formatter also allows more precise control by providing [sql-formatter configuration options](https://github.com/sql-formatter-org/sql-formatter#configuration-options). To provide these, create a `.sql-formatter.json` file in your project:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"language": "postgresql",
|
||||
"tabWidth": 2,
|
||||
@@ -55,7 +55,7 @@ Sql-formatter also allows more precise control by providing [sql-formatter confi
|
||||
|
||||
When using a `.sql-formatter.json` file you can use a more simplified set of Zed settings since the language need not be specified inline:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"SQL": {
|
||||
"formatter": {
|
||||
|
||||
@@ -9,7 +9,7 @@ Svelte support is available through the [Svelte extension](https://github.com/ze
|
||||
|
||||
You can modify how certain styles, such as directives and modifiers, appear in attributes:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"syntax": {
|
||||
// Styling for directives (e.g., `class:foo` or `on:click`) (the `on` or `class` part of the attribute).
|
||||
"attribute.function": {
|
||||
@@ -26,7 +26,7 @@ You can modify how certain styles, such as directives and modifiers, appear in a
|
||||
|
||||
When inlay hints is enabled in Zed, to make the language server send them back, Zed sets the following initialization options:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"inlayHints": {
|
||||
"parameterNames": {
|
||||
"enabled": "all",
|
||||
@@ -53,16 +53,16 @@ When inlay hints is enabled in Zed, to make the language server send them back,
|
||||
|
||||
To override these settings, use the following:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"svelte-language-server": {
|
||||
"initialization_options": {
|
||||
"configuration": {
|
||||
"typescript": {
|
||||
......
|
||||
// ......
|
||||
},
|
||||
"javascript": {
|
||||
......
|
||||
// ......
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ The extension doesn't attempt to download `lldb-dap` if it's not found.
|
||||
|
||||
#### Build and debug a Swift binary
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Debug Swift",
|
||||
|
||||
@@ -8,18 +8,18 @@ Zed has built-in support for Tailwind CSS autocomplete, linting, and hover previ
|
||||
|
||||
To configure the Tailwind CSS language server, refer [to the extension settings](https://github.com/tailwindlabs/tailwindcss-intellisense?tab=readme-ov-file#extension-settings) and add them to the `lsp` section of your `settings.json`:
|
||||
|
||||
```jsonc
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"tailwindcss-language-server": {
|
||||
"settings": {
|
||||
"classFunctions": ["cva", "cx"],
|
||||
"experimental": {
|
||||
"classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"classRegex": ["[cls|className]\\s\\:\\=\\s\"([^\"]*)"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -40,7 +40,7 @@ Languages which can be used with Tailwind CSS in Zed:
|
||||
|
||||
Zed supports Prettier out of the box, which means that if you have the [Tailwind CSS Prettier plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) installed, adding it to your Prettier configuration will make it work automatically:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
// .prettierrc
|
||||
{
|
||||
"plugins": ["prettier-plugin-tailwindcss"]
|
||||
|
||||
@@ -13,7 +13,7 @@ TBD: Add example using `rootModulePaths` to match upstream example https://githu
|
||||
|
||||
The Terraform language server can be configured in your `settings.json`, e.g.:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"terraform-ls": {
|
||||
|
||||
@@ -16,7 +16,7 @@ TBD: Document the difference between Language servers
|
||||
By default Zed uses [vtsls](https://github.com/yioneko/vtsls) for TypeScript, TSX, and JavaScript files.
|
||||
You can configure the use of [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) per language in your settings file:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"TypeScript": {
|
||||
@@ -34,7 +34,7 @@ You can configure the use of [typescript-language-server](https://github.com/typ
|
||||
|
||||
Prettier will also be used for TypeScript files by default. To disable this:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"languages": {
|
||||
"TypeScript": {
|
||||
@@ -49,7 +49,7 @@ Prettier will also be used for TypeScript files by default. To disable this:
|
||||
|
||||
`vtsls` may run out of memory on very large projects. We default the limit to 8092 (8 GiB) vs. the default of 3072 but this may not be sufficient for you:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"vtsls": {
|
||||
@@ -70,7 +70,7 @@ Zed sets the following initialization options to make the language server send b
|
||||
|
||||
You can override these settings in your Zed `settings.json` when using `typescript-language-server`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"typescript-language-server": {
|
||||
@@ -95,7 +95,7 @@ See [typescript-language-server inlayhints documentation](https://github.com/typ
|
||||
|
||||
When using `vtsls`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"lsp": {
|
||||
"vtsls": {
|
||||
@@ -174,7 +174,7 @@ If your use-case isn't covered by any of these, you can take full control by add
|
||||
|
||||
Given an externally-ran web server (e.g., with `npx serve` or `npx live-server`) one can attach to it and open it with a browser.
|
||||
|
||||
```json
|
||||
```json [debug]
|
||||
[
|
||||
{
|
||||
"label": "Launch Chrome (TypeScript)",
|
||||
|
||||
@@ -8,7 +8,7 @@ XML support is available through the [XML extension](https://github.com/sweetppr
|
||||
|
||||
If you have additional file extensions that are not being automatically recognized as XML just add them to [file_types](../configuring-zed.md#file-types) in your Zed settings:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"file_types": {
|
||||
"XML": ["rdf", "gpx", "kml"]
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ YAML support is available natively in Zed.
|
||||
|
||||
You can configure various [yaml-language-server settings](https://github.com/redhat-developer/yaml-language-server?tab=readme-ov-file#language-server-settings) by adding them to your Zed settings.json in a `yaml-language-server` block under the `lsp` key. For example:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"yaml-language-server": {
|
||||
"settings": {
|
||||
@@ -38,7 +38,7 @@ By default, Zed uses Prettier for formatting YAML files.
|
||||
|
||||
You can customize the formatting behavior of Prettier. For example to use single-quotes in yaml files add the following to your `.prettierrc` configuration file:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
{
|
||||
"overrides": [
|
||||
{
|
||||
@@ -55,7 +55,7 @@ You can customize the formatting behavior of Prettier. For example to use single
|
||||
|
||||
To use `yaml-language-server` instead of Prettier for YAML formatting, add the following to your Zed `settings.json`:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"languages": {
|
||||
"YAML": {
|
||||
"formatter": "language_server"
|
||||
@@ -79,7 +79,7 @@ on:
|
||||
|
||||
You can disable the automatic detection and retrieval of schemas from the JSON Schema if desired:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"yaml-language-server": {
|
||||
"settings": {
|
||||
@@ -99,7 +99,7 @@ Yaml-language-server supports [custom tags](https://github.com/redhat-developer/
|
||||
|
||||
For example Amazon CloudFormation YAML uses a number of custom tags, to support these you can add the following to your settings.json:
|
||||
|
||||
```json
|
||||
```json [settings]
|
||||
"lsp": {
|
||||
"yaml-language-server": {
|
||||
"settings": {
|
||||
|
||||
Reference in New Issue
Block a user