posit-dev / posit-dev/positron

Add a Python "code action" to generate a docstring for a Python function

Open
#10,522 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement lang: python support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

Originally posted by @Mkranj in https://github.com/posit-dev/positron/discussions/10506:

in the Edit pane. Similar to Rstudio's "Insert Roxygen Skeleton", I'd love to see that replicated for R code, and a similar docstring being created for Python code.
The syntax to be used (R or Python) could be gleaned from the current file extension.


We used a code action to do this in R in https://github.com/posit-dev/ark/pull/809, and I think it would be best to access that functionality available in a similar way.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Edit pane's code-action integration and review the code-actions approach described in posit-dev/ark#809. Use the current file extension to determine Python syntax, and consider the work complete when a Python function can invoke an action that generates its docstring.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, r, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.