{"id":13600790,"url":"https://github.com/yaegassy/coc-pylsp","last_synced_at":"2025-05-07T19:05:03.704Z","repository":{"id":42226216,"uuid":"359307201","full_name":"yaegassy/coc-pylsp","owner":"yaegassy","description":"pylsp (python-lsp-server) extension for coc.nvim.","archived":false,"fork":false,"pushed_at":"2025-02-09T11:22:34.000Z","size":491,"stargazers_count":36,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T03:34:13.184Z","etag":null,"topics":["coc","coc-extensions","coc-nvim","lsp","neovim","pylsp","python","vim"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@yaegassy/coc-pylsp","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaegassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-19T02:37:18.000Z","updated_at":"2025-04-25T19:41:58.000Z","dependencies_parsed_at":"2024-08-28T04:50:38.640Z","dependency_job_id":"e6e9cebd-ce15-4b60-9e2d-2ca73aa182c6","html_url":"https://github.com/yaegassy/coc-pylsp","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pylsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pylsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pylsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaegassy%2Fcoc-pylsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaegassy","download_url":"https://codeload.github.com/yaegassy/coc-pylsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252940883,"owners_count":21828766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coc","coc-extensions","coc-nvim","lsp","neovim","pylsp","python","vim"],"created_at":"2024-08-01T18:00:48.665Z","updated_at":"2025-05-07T19:05:03.629Z","avatar_url":"https://github.com/yaegassy.png","language":"TypeScript","funding_links":[],"categories":["Language Support"],"sub_categories":[],"readme":"# coc-pylsp\n\n[pylsp](https://github.com/python-lsp/python-lsp-server) (python-lsp-server) extension for [coc.nvim](https://github.com/neoclide/coc.nvim).\n\n\u003cimg width=\"780\" alt=\"coc-pylsp-demo\" src=\"https://user-images.githubusercontent.com/188642/115177162-97e3d300-a109-11eb-94dd-a6a7989b4a06.gif\"\u003e\n\n## Install\n\n**CocInstall**:\n\n```vim\n:CocInstall @yaegassy/coc-pylsp\n```\n\n**vim-plug**:\n\n```vim\nPlug 'yaegassy/coc-pylsp', {'do': 'yarn install --frozen-lockfile'}\n```\n\n## Detect: pylsp (python-lsp-server)\n\ncoc-pylsp detects and starts pylsp.\n\n**Priority to detect**:\n\n1. pylsp.commandPath\n1. current python3/python environment (e.g. pylsp in venv)\n1. builtin pylsp (Installation commands are also provided)\n\n## Built-in install (pylsp and 3rd party plugins)\n\n`coc-pylsp` allows you to create an extension-only \"venv\" and install \"pylsp (python-lsp-server)\" and \"related tools\" (e.g. pylsp-mypy).\n\nBy default, it is installed with `pip install python-lsp-server[all]`. (extras_require).\n\n\u003c!-- markdownlint-disable-next-line --\u003e\nIf you want to change \"extras_require\", please change the `pylsp.builtin.installExtrasArgs` setting\n\n**example**:\n\n- Example1: `\"pylsp.builtin.installExtrasArgs\": []`\n  - `pip install python-lsp-server`\n- Example2: `\"pylsp.builtin.installExtrasArgs\": [\"all\"]`:\n  - `pip install 'python-lsp-server[all]'`\n- Example3: `\"pylsp.builtin.installExtrasArgs\": [\"yapf\", \"flake8\"]`:\n  - `pip install 'python-lsp-server[yapf,flake8]'`\n\n---\n\nIt also supports the installation of \"3rd Party Plugins\".\n\n- 3rd Party Plugins currently supported\n  - [pylsp-mypy](https://github.com/Richardk2n/pylsp-mypy)\n  - [pyls-isort](https://github.com/paradoxxxzero/pyls-isort)\n  - [python-lsp-black](https://github.com/python-lsp/python-lsp-black)\n  - [pylsp-rope](https://github.com/python-rope/pylsp-rope)\n  - [python-lsp-ruff](https://github.com/python-lsp/python-lsp-ruff)\n\nBy default, the installation of 3rd Party Plugins is \"disabled\".\n\nTo \"enable\" it, change each setting in `coc-settings.json`.\n\n```jsonc\n{\n  // snip...\n  \"pylsp.builtin.enableInstallPylspMypy\": true,\n  \"pylsp.builtin.enableInstallPylsIsort\": true,\n  \"pylsp.builtin.enableInstallPythonLspBlack\": true,\n  \"pylsp.builtin.enableInstallPylspRope\": true,\n  \"pylsp.builtin.enableInstallPythonLspRuff\": true,\n  // snip...\n}\n```\n\nIt is also possible to specify the version of the third party tool to be installed\n\n```jsonc\n{\n  // snip...\n  \"pylsp.builtin.pylspMypyVersion\": \"0.5.2\",\n  \"pylsp.builtin.pylsIsortVersion\": \"0.2.2\",\n  \"pylsp.builtin.pythonLspBlackVersion\": \"1.0.1\",\n  \"pylsp.builtin.pylspRopeVersion\": \"0.1.10\",\n  \"pylsp.builtin.pythonLspRuffVersion\": \"1.0.5\",\n  // snip...\n}\n```\n\n---\n\n\u003c!-- markdownlint-disable-next-line --\u003e\nThe first time you use coc-pylsp, if pylsp is not detected, you will be prompted to do a built-in installation.\n\nYou can also run the installation command manually.\n\n```vim\n:CocCommand pylsp.builtin.install\n```\n\n### python-lsp-ruff\n\nIf you enable `python-lsp-ruff` then you will probably want to disable the built-in `pycodestyle`,\n`pyflakes`, `mccabe` and `pyls_isort` plugins, for example:\n```\n{\n  \"pylsp.plugins.pycodestyle.enabled\": false,\n  \"pylsp.plugins.pyflakes.enabled\": false\n  \"pylsp.plugins.mccabe.enabled\": false,\n  \"pylsp.plugins.pyls_isort.enabled\": false,\n}\n```\nAlthough `python-lsp-ruff` tries to disable these automatically, they must be explicitly disabled\nwhen using `coc-pylsp`.\n\n## Use tcp mode\n\nTo use the tcp mode, set `pylsp.connectionMode` to `'tcp'`. Also, pylsp needs to be started in tcp mode separately.\n\n**coc-settings.json**:\n\n```json\n{\n  \"pylsp.connectionMode\": \"tcp\"\n}\n```\n\n**How to start pylsp in tcp mode**:\n\n```sh\n# By default, host is 127.0.0.1 and port 2087 is set\npylsp --tcp\n# Or specify any host (--host) and port (--port)\npylsp --tcp --host 127.0.0.1 --port 2087\n```\n\n## Configuration options\n\n- `pylsp.enable`: Enable coc-pylsp extension, default: `true`\n- `pylsp.trace.server`: Traces the communication between coc.nvim and the Python LSP Server, default: `\"off\"`\n- `pylsp.commandPath`: Custom path to the pylsp command. `~` and `$HOME`, etc. can also be used. If not set, pylsp detected by the current python environment or extension venv's pylsp used will be used, default: `\"\"`\n- `pylsp.connectionMode`: Controls the communication method to pylsp, valid option `[\"stdio\", \"tcp\"]`, default: `stdio`\n- `pylsp.tcpHost`: Specifies the host name to connect pylsp. This setting only works with connectionMode is 'tcp', default: `\"127.0.0.1\"`\n- `pylsp.tcpPort`: Specifies the port to connect pylsp. This setting only works with connectionMode is 'tcp', default: `2087`\n- `pylsp.disableProgressNotifications`: Disable the initialization and workdone progress notifications, default: `true`\n- `pylsp.builtin.pythonPath`: Python 3.x path (Absolute path) to be used for built-in install, default: `\"\"`\n- `pylsp.builtin.installExtrasArgs`: Setting extras_require for built-in installation, default: `[\"all\"]`\n- `pylsp.builtin.enableInstallPylspMypy`: Enable/Disable built-in install of `pylsp-mypy`, default: `false`\n- `pylsp.builtin.enableInstallPylsIsort`: Enable/Disable built-in install of `pyls-isort`, default: `false`\n- `pylsp.builtin.enableInstallPythonLspBlack`: Enable/Disable built-in install of `python-lsp-black`, default: `false`\n- `pylsp.builtin.enableInstallPylspRope`: Enable/Disable built-in install of `pylsp-rope`, default: `false`\n- `pylsp.builtin.enableInstallPythonLspRuff`: Enable/Disable built-in install of pylsp-lsp-ruff, default: `true`\n- `pylsp.builtin.pylspMypyVersion`: Version of pylsp-mypy for built-in install, e.g. \"0.5.2\", default: `\"\"`\n- `pylsp.builtin.pylsIsortVersion`: Version of pyls-isort for built-in install, e.g. \"0.2.2\", default: `\"\"`\n- `pylsp.builtin.pythonLspBlackVersion`: Version of python-lsp-black for built-in install, e.g. \"1.0.1\" default: `\"\"`\n- `pylsp.builtin.pylspRopeVersion`: Version of pylsp-rope for built-in install, default: `\"\"`\n- `pylsp.builtin.pythonLspRuffVersion`: Version of python-lsp-ruff for built-in install, default: `\"\"`\n\nFor other settings, Check the \"configuration\" section of [package.json](/package.json).\n\n## Commands\n\n- `pylsp.builtin.install`: Install python lsp server and related tools\n  - pylsp will be installed in this path.\n    - Mac/Linux: `~/.config/coc/extensions/@yaegassy/coc-pylsp-data/pylsp/venv/bin/pylsp`\n    - Windows: `~/AppData/Local/coc/extensions/@yaegassy/coc-pylsp-data/pylsp/venv/Scripts/pylsp.exe`\n  - 3rd Party Plugins will also be installed in the same `venv`\n\n## Thanks\n\n- [python-lsp/python-lsp-server](https://github.com/python-lsp/python-lsp-server)\n\n## License\n\nMIT\n\n---\n\n\u003e This extension is built with [create-coc-extension](https://github.com/fannheyward/create-coc-extension)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-pylsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaegassy%2Fcoc-pylsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaegassy%2Fcoc-pylsp/lists"}