zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.49k stars 3.13k forks source link

LSP settings don't seem to be updated. #20923

Open bingis-khan opened 2 days ago

bingis-khan commented 2 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I'm trying to configure my LSP client (Haskell Language Server). It seems like options in settings.json are completely ignored and not passed to the LSP. Tried restarting the editor with every change, but nothing happened.

Environment

Zed: v0.162.3 (Zed) OS: macOS 10.15.7 Memory: 4 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

The current configuration I'm using (I tried different configurations of this configuration, none seemed to change a thing):

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
  "ui_font_size": 16,
  "buffer_font_size": 16,
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "One Dark"
  },

  "lsp": {
    "hls": {
      "haskell.formattingProvider": "hls-fourmolu-plugin"
    }
  },

  "languages": {
    "Haskell": {
      "tab_size": 2,
      "formatter": "language_server",
      "language_servers": ["hls"]
    }
  }
}

If applicable, attach your Zed.log file to this issue.

Zed.log ``` [Zed.log](https://github.com/user-attachments/files/17835658/Zed.log) ```
osiewicz commented 2 days ago

Your settings should probably be:

  "lsp": {
    "hls": {
       "initialization_options": {
        "haskell": {
          "formattingProvider": "hls-fourmolu-plugin"
        }
      }
    }
  },

Note that I don't have a Haskell environment set up, so I can't really vouch for it truly working. You definitely need to wrap your settings in initialization_options though.