josa42 / coc-sh

SH language server extension using bash-language-server for coc.nvim.
MIT License
205 stars 4 forks source link

Server sh failed to start #64

Closed pvonmoradi closed 1 year ago

pvonmoradi commented 2 years ago

This happened due to a recent update I believe. I fixed coc-nvim at v0.0.81 and removed the plugin and re-installed. Same error. I also fixed the coc-sh plugin at v0.6.1 (with coc 0.0.81), same error. Now I changed it back to latest stable. It was working fine for 0.7 though as I've updated since Jun 11.

## versions

vim version: VIM - Vi IMproved 9.0 9000105
node version: v12.22.12
coc.nvim version: 0.0.81-21a8e00b 2022-05-26 03:12:31 +0800
coc.nvim directory: /home/pooya/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2022-08-12T18:14:03.744 INFO (pid:11843) [services] - registered service "diagnostic-languageserver"
2022-08-12T18:14:03.744 INFO (pid:11843) [services] - diagnostic language service state change: stopped => starting
2022-08-12T18:14:03.806 INFO (pid:11843) [services] - registered service "sh"
2022-08-12T18:14:03.806 INFO (pid:11843) [services] - bash-language-server state change: stopped => starting
2022-08-12T18:14:03.806 INFO (pid:11843) [plugin] - coc.nvim initialized with node: v12.22.12 after 197ms
2022-08-12T18:14:03.808 INFO (pid:11843) [attach] - receive notification: registNotification [ 'cquery', '$cquery/publishSemanticHighlighting' ]
2022-08-12T18:14:03.808 INFO (pid:11843) [attach] - receive notification: registNotification [ 'cquery', '$cquery/setInactiveRegions' ]
2022-08-12T18:14:03.808 INFO (pid:11843) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSemanticHighlight' ]
2022-08-12T18:14:03.808 INFO (pid:11843) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSkippedRanges' ]
2022-08-12T18:14:03.837 INFO (pid:11843) [language-client-index] - Language server "sh" started with 11864
2022-08-12T18:14:03.900 INFO (pid:11843) [services] - bash-language-server state change: starting => stopped
2022-08-12T18:14:03.900 INFO (pid:11843) [services] - bash-language-server state change: stopped => starting
2022-08-12T18:14:03.904 INFO (pid:11843) [language-client-index] - Language server "sh" started with 11871
2022-08-12T18:14:03.958 INFO (pid:11843) [services] - bash-language-server state change: starting => stopped
2022-08-12T18:14:03.958 INFO (pid:11843) [services] - bash-language-server state change: stopped => starting
2022-08-12T18:14:03.961 INFO (pid:11843) [language-client-index] - Language server "sh" started with 11878
2022-08-12T18:14:03.988 INFO (pid:11843) [services] - diagnostic language service state change: starting => running
2022-08-12T18:14:03.991 INFO (pid:11843) [services] - service diagnostic-languageserver started
2022-08-12T18:14:04.010 INFO (pid:11843) [services] - bash-language-server state change: starting => stopped
2022-08-12T18:14:04.010 INFO (pid:11843) [services] - bash-language-server state change: stopped => starting
2022-08-12T18:14:04.014 INFO (pid:11843) [language-client-index] - Language server "sh" started with 11885
2022-08-12T18:14:04.058 INFO (pid:11843) [services] - bash-language-server state change: starting => stopped
2022-08-12T18:14:04.058 ERROR (pid:11843) [services] - Server sh failed to start: Error: Connection to server got closed. Server will not be restarted.
    at Wf.handleConnectionClosed (/home/pooya/.vim/plugged/coc.nvim/build/index.js:234:1006)
    at Wf.handleConnectionClosed (/home/pooya/.vim/plugged/coc.nvim/build/index.js:234:28572)
    at t (/home/pooya/.vim/plugged/coc.nvim/build/index.js:234:386)
    at DN.invoke (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:9670)
    at Md.fire (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:10436)
    at Ci (/home/pooya/.vim/plugged/coc.nvim/build/index.js:37:10897)
    at DN.invoke (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:9670)
    at Md.fire (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:10436)
    at jS.fireClose (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:12716)
    at Socket.<anonymous> (/home/pooya/.vim/plugged/coc.nvim/build/index.js:36:14275)
2022-08-12T18:14:09.208 INFO (pid:11843) [attach] - receive notification: showInfo []

Here is the relevant settings from coc-settings.json:

    // coc-sh
    "sh.enable": true,
    // diagnostic-lsp
    "diagnostic-languageserver.filetypes": {
        // lint `sh` (includes `bash`) files
        "sh": "shellcheck"
    },
    "diagnostic-languageserver.formatFiletypes": {
        // format `sh` (includes `bash`) files using formatter defined below
        "sh": "shfmt"
    },
    "diagnostic-languageserver.formatters": {
        // define our formatter so that we can reference it from
        // `diagnostic-languageserver.formatFiletypes`
        "shfmt": {
            "command": "shfmt",
            // all the below args are entirely optional
            // primarily listed here to call out that flags which take an
            // argument (such as `-i <num-spaces>` for specifying indentation)
            // should be split into two strings, the flag and then the value
            "args": [
                "-i",
                "4",
                "-bn",
                "-ci",
                "-sr"
            ]
        }
    },