rgbkrk / python-lsp-zed-extension

Python LSP Server Zed Extension
28 stars 1 forks source link

Empty config fails to start pylsp #1

Open rgbkrk opened 3 months ago

rgbkrk commented 3 months ago

pylsp will fail to start if config isn't set.

I didn't notice this until I commented out my config:

    // "pylsp": {
    //   "settings": {
    //     "printWidth": 120,
    //     "plugins": {
    //       "pycodestyle": {
    //         "enabled": true,
    //         "ignore": ["E501"]
    //       },
    //       "mypy": {
    //         "live_mode": true,
    //         "enabled": true
    //       },
    //       "rope_autoimport": {
    //         "enabled": true
    //       },
    //       "rope_completion": {
    //         "enabled": true
    //       }
    //     }
    //   }
    // },
nia1048596 commented 3 weeks ago

Just running into this. Using strace reveals that the extension sends null settings to pylsp

65772 write(2545, "Content-Length: 98\r\n\r\n{\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":{\"pylsp\":null}}}", 120) = 120

On the pylsp side, it updates settings to none.

https://github.com/python-lsp/python-lsp-server/blob/eb61ccd97bbe9c58fbde6496a78015ee3c129146/pylsp/config/config.py#L192

65925 write(2, "2024-11-07 08:59:38,120 CST - INFO - pylsp.config.config - Updated settings to None\n", 84) = 84