Package Exports
- @yaegassy/coc-ruff
- @yaegassy/coc-ruff/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yaegassy/coc-ruff) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
coc-ruff
ruff-lsp extension for coc.nvim.
Install
CocInstall:
:CocInstall @yaegassy/coc-ruffscoped packages
e.g. vim-plug:
Plug 'yaegassy/coc-ruff', {'do': 'yarn install --frozen-lockfile'}Note
The ruff command used by ruff-lsp uses the ruff command installed with the ruff-lsp dependency.
To use the ruff command installed in the virtual environment of a project created by venv, poetry, etc., ruff.path must be set to an absolute path.
coc-ruff adds the feature to automatically detect ruff commands in the execution environment and use them in ruff-lsp.
If you do not need this feature, set ruff.useDetectRuffCommand to false.
coc-settings.json:
{
"ruff.useDetectRuffCommand": false
}Order of detection of ruff-lsp used by extensions
coc-ruff detects and starts ruff-lsp in the following priority order.
ruff.serverPath(If there is a setting)- current python3/python environment (e.g. ruff-lsp in global or virtual environment)
- built-in ruff-lsp (Installation commands are also provided)
Bult-in install
coc-ruff allows you to create an extension-only "venv" and install ruff-lsp.
When using coc-ruff for the first time, if ruff-lsp is not present in the runtime environment, you will be prompted to do a built-in install.
To use the built-in installation feature, execute the following command.
:CocCommand ruff.builtin.installServerConfiguration options
ruff.enable: Enable coc-ruff extension, default:trueruff.useDetectRuffCommand: Automatically detects the ruff command in the execution environment and setsruff.path, default:trueruff.serverPath: Custom path to theruff-lspcommand. If not set, theruff-lspcommand found in the current Python environment or in the venv environment created for the extension will be used, default:""ruff.builtin.pythonPath: Python 3.x path (Absolute path) to be used for built-in install, default:""ruff.trace.server: Traces the communication between coc.nvim and the ruff-lsp, default:"off"
Other settings have the same configuration as ruff-vscode.
Commands
ruff.executeAutofix: Fix all auto-fixable problemsruff.executeOrganizeImports: Format importsruff.restart: Restart Serverruff.builtin.installServer: Install ruff-lsp- It will be installed in this path:
- Mac/Linux:
~/.config/coc/extensions/@yaegassy/coc-ruff-data/ruff-lsp/venv/bin/ruff-lsp
- Windows:
~/AppData/Local/coc/extensions/@yaegassy/coc-ruff-data/ruff/venv/Scripts/ruff-lsp.exe
- Mac/Linux:
- It will be installed in this path:
Thanks
License
MIT
This extension is built with create-coc-extension