V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
octalempyrean
V2EX  ›  Vim

CocInstall coc- Python 错误

  •  
  •   octalempyrean · 2020-01-29 16:22:44 +08:00 · 3431 次点击
    这是一个创建于 1542 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    1.jpg 2.jpg 3.jpg

    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
              }
            }
          }
        }
      }
    }
    
    6 条回复    2020-02-18 01:44:51 +08:00
    octalempyrean
        1
    octalempyrean  
    OP
       2020-01-29 16:35:33 +08:00
    PTLin
        2
    PTLin  
       2020-01-29 17:34:53 +08:00
    不用 CocConfig 特意配置 ls,我直接安装完插件就能用了。
    yuuko
        3
    yuuko  
       2020-01-29 20:55:22 +08:00 via Android
    配置文件是个 json,检查下格式对不对
    luassuns
        4
    luassuns  
       2020-01-30 14:27:01 +08:00
    CocCofig 的 josn 最外面还要套一个 {} ,如果用了 coc-python 就不用配置 CocConfig 了。
    octalempyrean
        5
    octalempyrean  
    OP
       2020-01-30 15:59:15 +08:00 via Android
    @luassuns 嗯,如果配置 CocConfig 需要执行 CocInstall coc-python 么?
    yiningyang1228
        6
    yiningyang1228  
       2020-02-18 01:44:51 +08:00
    可以试试在 CocConfig 只添加
    ```
    {
    "python.jediEnabled": false,
    }
    ```

    ,然后直接 CocInstall coc-python。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1030 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:13 · PVG 03:13 · LAX 12:13 · JFK 15:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.