coc-pyright-tools is a coc-extension that adds its own functionality to coc-pyright for coc.nvim. Currently the "Inlay Hints", "CodeLens" and "Test Framework commands" feature is available.

Overview

coc-pyright-tools

!!WARNING!!

Inlay hints feature of coc-pyright-tools, have been ported to coc-pyright itself. https://github.com/fannheyward/coc-pyright/commit/1f36838eaacc0d564946733e847a785709550966

coc-pyright-tools is no longer maintained


coc-pyright-tools is a coc-extension that adds its own functionality to coc-pyright for coc.nvim. Currently the "Inlay Hints", "CodeLens" and "Test Framework commands" feature is available.

Install

e.g. vim-plug:

Plug 'yaegassy/coc-pyright-tools', {'do': 'yarn install --frozen-lockfile'}

Requirement

You must have coc-pyright installed to use the features of coc-pyright-tools. Check the coc-pyright repository for installation instructions.

Features

Inlay Hints

Pyright itself does not provide inlay hints, but implements client-based Pylance-like inlay hints feature.

Check about Pylance inlay type hints. See: https://devblogs.microsoft.com/python/python-in-visual-studio-code-july-2022-release/#inlay-type-hints

DEMO (mp4):

coc-pyright-tools-inlay-hints.mp4

CodeLens

Running test such as unittest, pytest, etc.

DEMO (mp4):

coc-pyright-tools-code-lens-unittest.mp4

Commands

  • pyright-tools.toggleInlayHints: Toggle enable/disable inlay hints
  • pyright-tools.unittest.fileTest: Run unittest for current file
  • pyright-tools.unittest.singleTest: Run unittest for single (nearest) test
  • pyright-tools.pytest.fileTest: Run pytest for current file
  • pyright-tools.pytest.singleTest: Run pytest for single (nearest) test

Configuration options

  • pyright-tools.enable: Enable coc-pyright-tools extension, default: true
  • pyright-tools.python.interpreterPath: Path to the Python interpreter executable. Particularly important if you are using a Python virtual environment. Leave blank to use Python from PATH, default: ""
  • pyright-tools.inlayHints.enable: Enable/disable inlay hints feature, true
  • pyright-tools.inlayHints.functionReturnTypes: Enable/disable inlay hints for function return types, default: true
  • pyright-tools.inlayHints.variableTypes: Enable/disable inlay hints for variable types, default: true
  • pyright-tools.codeLens.enable: Enable/disable codelens feature, default: true
  • pyright-tools.codeLens.testFramework: Testing framework used by codelens, valid options ["unittest", "pytest"], default: unittest
  • pyright-tools.codeLens.unittestTitle: CodeLens title. Can be changed to any display, default: >> [Run unittest]
  • pyright-tools.codeLens.pytestTitle: CodeLens title. Can be changed to any display, default: >> [Run pytest]
  • pyright-tools.test.unittestArgs: Arguments passed in. Each argument is a separate item in the array, default: []
  • pyright-tools.test.pytestArgs: Arguments passed in. Each argument is a separate item in the array, default: []
  • pyright-tools.terminal.enableSplitRight: Use vertical belowright for unittest/pytest terminal window, default: false

Thanks

License

MIT


This extension is built with create-coc-extension

You might also like...

A tampermonkey script that adds functionality to the midjourney.com website to make it easier to do things.

A tampermonkey script that adds functionality to the midjourney.com website to make it easier to do things.

MidJourneyTools A tampermonkey script that adds functionality to the midjourney.com website to make it easier to do things. Setup Instructions Make su

Dec 24, 2022

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Dec 26, 2022

Theme Redone is a custom WordPress theme starter/framework with its own Gutenberg blocks solution and a CLI that speeds up the block creation process.

Theme Redone is a custom WordPress theme starter/framework with its own Gutenberg blocks solution and a CLI that speeds up the block creation process.

Theme Redone The Framework for Developing Custom WordPress Themes with its own Gutenberg Blocks creation solution. Theme Redone is a custom WordPress

Dec 30, 2022

A community-led token scanner for Replit utilizing its own APIs.

A community-led token scanner for Replit utilizing its own APIs.

Replit Token Scanner A community-led project that aims to scan published Repls to find secrets and invalidate them. Usage This repo contains the scann

Nov 6, 2022

This extensions adds blocks to help you create your own carnival games in MakeCode Arcade using throwable balls, extra timer functions, and extra game-over options.

Usage This extensions adds blocks to help you create your own carnival games in MakeCode Arcade using throwable balls, extra timer functions, and extr

Nov 16, 2022

An extension to Panic's Nova editor currently providing an alternative file browser.

Explorer.novaextension Welcome to the repository of the Explorer Nova extension. The actual extension and its README can be found only one directory a

Nov 14, 2022

This React-Based WebPage allows the client/user system to create their own blog, where users can publish their own opinions.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Jul 28, 2022

zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

Aug 25, 2022

This is a boilerplate for creating your own languages for various use cases. You can even create your own programming language from scratch!

Bootstrap compiler This is a bootstrap compiler that can be used to compile to compiler written in the target language. You can write a compiler in th

Nov 14, 2022
Comments
  • feat(codelens): add Codelens to run TestFramework

    feat(codelens): add Codelens to run TestFramework

    DEMO [unittest] (mp4)

    https://user-images.githubusercontent.com/188642/184796894-66b622bb-15e5-41f1-9562-42cd46ed7bc6.mp4

    DEMO [pytest] (mp4)

    Setting "pyright-tools.codeLens.testFramework": "pytest"

    https://user-images.githubusercontent.com/188642/184796927-3629123a-6f98-4fe9-b680-de360921154a.mp4

    opened by yaegassy 0
Owner
yaegassy
yaegassy
Alpine.js Language Features (Volar) extension for coc.nvim

[Experimental] coc-volar-alpinejs fork from vscode-alpine-language-features Alpine Language Features extension for coc.nvim Note @volar/alpine-languag

yaegassy 6 Oct 12, 2022
Vitest for coc.nvim

coc-vitest Vitest for coc.nvim Install vim-plug: Plug 'yaegassy/coc-vitest', {'do': 'yarn install --frozen-lockfile'} CocInstall: Not supported at thi

yaegassy 8 Sep 4, 2022
Solidity language server for coc.nvim

coc-solidity coc.nvim extension for solidity. Language server provided by solidity-ls. solidity-ls has no tolerance. Means that some features will onl

7c00 40 Dec 5, 2022
Intelligent Tailwind CSS tooling for coc.nvim

coc-tailwindcss3 fork from a vscode-tailwindcss Intelligent Tailwind CSS tooling for coc.nvim. Motivation There are two coc.nvim extensions to "tailwi

yaegassy 110 Jan 1, 2023
Typos integration with coc.nvim

coc-typos Typos integration with coc.nvim. It checks typos with opened buffer automatically. Install Install typos by: cargo install typos-cli Make s

Neoclide 31 Aug 22, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
It's a repository to studies. Its idea is to learn about Nx and its plugins.

StudyingNx This project was generated using Nx. ?? Smart, Fast and Extensible Build System Adding capabilities to your workspace Nx supports many plug

Open-ish 4 May 13, 2022
Can see everything, beware of its omniscience, kneel before its greatness.

Can see everything, beware of its omniscience, kneel before its greatness. Summary Presentation Installation Removing Credits Presentation Main goal T

Duc Justin 3 Sep 30, 2022