CocInstall coc- Python 错误

2020-01-29 16:22:44 +08:00
 octalempyrean

Coc 对 python 语言的支持扩展怎么安装啊,看了下 wiki,有点迷糊,是我笨。

  1. 语言服务器的代码是要复制至 CocConfig 文件中么?
  2. 已经安装了 pip3 install 'python-language-server[all]'了。
  3. 当在 VIM 中执行 CocInstall coc-python 的时候出现错误……,错误提示见下图。
  4. 将下面代码放到 CocCofig 文件中 VIM 启动时有错误提示。

Example with python-language-server 代码如下:

"languageserver": {
  "python": {
    "command": "python",
    "args": [
      "-mpyls",
      "-vv",
      "--log-file",
      "/tmp/lsp_python.log"
    ],
    "trace.server": "verbose",
    "filetypes": [
      "python"
    ],
    "settings": {
      "pyls": {
        "enable": true,
        "trace": {
          "server": "verbose"
        },
        "commandPath": "",
        "configurationSources": [
          "pycodestyle"
        ],
        "plugins": {
          "jedi_completion": {
            "enabled": true
          },
          "jedi_hover": {
            "enabled": true
          },
          "jedi_references": {
            "enabled": true
          },
          "jedi_signature_help": {
            "enabled": true
          },
          "jedi_symbols": {
            "enabled": true,
            "all_scopes": true
          },
          "mccabe": {
            "enabled": true,
            "threshold": 15
          },
          "preload": {
            "enabled": true
          },
          "pycodestyle": {
            "enabled": true
          },
          "pydocstyle": {
            "enabled": false,
            "match": "(?!test_).*\\.py",
            "matchDir": "[^\\.].*"
          },
          "pyflakes": {
            "enabled": true
          },
          "rope_completion": {
            "enabled": true
          },
          "yapf": {
            "enabled": true
          }
        }
      }
    }
  }
}
3454 次点击
所在节点    Vim
6 条回复
octalempyrean
2020-01-29 16:35:33 +08:00
PTLin
2020-01-29 17:34:53 +08:00
不用 CocConfig 特意配置 ls,我直接安装完插件就能用了。
yuuko
2020-01-29 20:55:22 +08:00
配置文件是个 json,检查下格式对不对
luassuns
2020-01-30 14:27:01 +08:00
CocCofig 的 josn 最外面还要套一个 {} ,如果用了 coc-python 就不用配置 CocConfig 了。
octalempyrean
2020-01-30 15:59:15 +08:00
@luassuns 嗯,如果配置 CocConfig 需要执行 CocInstall coc-python 么?
yiningyang1228
2020-02-18 01:44:51 +08:00
可以试试在 CocConfig 只添加
```
{
"python.jediEnabled": false,
}
```

,然后直接 CocInstall coc-python。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/640832

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX