posit-dev / posit-dev/positron

Create new command to interpolate text into code, to run in the console

Open
#5,797 5 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: console area: core enhancement support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

In https://github.com/posit-dev/positron/discussions/5747 we've got a feature request for a command similar to workbench.action.executeCode.console that would allow someone to interpolate a selection into a bit of code, to run in the console. Something like this:

{
    "key": "Cmd+Shift+S",
    "command": "workbench.action.executeSelection.console",
    "when": "editorTextFocus",
    "args": {
        "langId": "r",
        "code": "str(${selectedText})",
        "focus": true
    }
}

You can already run selected code, but this is about selecting code and then constructing/interpolating a new bit of code to run.

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 by comparing the requested command with workbench.action.executeCode.console and reviewing discussion 5747. Trace how the example's selectedText, langId, code, and focus arguments should be handled. Done means a command like workbench.action.executeSelection.console can interpolate the selection into code and run it in the console.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.