From b8bda75048a8c96795beaf6b22fd2490868df03d Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 19 Aug 2022 10:12:48 +0200 Subject: [PATCH] Added instructions on how to use the pyright language server --- docs/language_servers.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/language_servers.md b/docs/language_servers.md index ee7873c..0710147 100644 --- a/docs/language_servers.md +++ b/docs/language_servers.md @@ -60,6 +60,8 @@ cp /usr/local/bin/javascript-language-server /usr/local/bin/typescriptreact-lang - Python3 - In juCi++ preferences, set `project.python_command` to `python3 -u` +### Python LSP Server + Install language server, and create symbolic link to enable server in juCi++: ```sh @@ -74,6 +76,29 @@ ln -s `which pylsp` /usr/local/bin/python-language-server `printf '[pycodestyle]\nmax-line-length = 120\n\n[yapf]\nCOLUMN_LIMIT = 120\n' > setup.cfg` - Add an empty `.python-format` file to enable style format on save +### Pyright + +- Prerequisite: + - Node.js +- Recommended: + - [YAPF](https://github.com/google/yapf) for style format (`pip3 install yapf`) + +Install language server, and create executable to enable server in juCi++: + +```sh +npm install -g pyright + +# Usually as root: +echo '#!/bin/sh +pyright-langserver --stdio' > /usr/local/bin/python-language-server +chmod 755 /usr/local/bin/python-language-server +``` + +- Additional setup within a Python project: + - Add Pyright configuration file: `echo '{}' > pyrightconfig.json` + - Add style format file to enable format on save, for instance: + `printf '[style]\nCOLUMN_LIMIT = 120\n' > .style.yapf` + ## Rust - Prerequisites: