5

I am new to the Positron IDE and I'd like to automatically insert parentheses () when coding in Python. For example, when I type len and hit Enter to confirm, it does not automatically insert parentheses ().

After searching online, it seems that in VS Code, there is a setting:

"python.analysis.completeFunctionParens": true

However, this is not supported in the Positron IDE. I wonder how to achieve this feature?

6
  • Make sure you have connected to the proper Python kernel, whether it's conda or something else Commented Aug 21 at 8:57
  • Yes, the Python kernel is connected to miniconda. Commented Aug 25 at 16:26
  • try adding a vscode plugin Commented Aug 26 at 17:50
  • 3
    We have a feature request for this on the Positron repo, and I've added info on your request there. Since we use a different Python LSP than VS Code does for licensing reasons, we don't have quite the same support for all features yet. Commented Aug 28 at 1:26
  • 1
    Actually, you can try to make a custom extension Commented Aug 30 at 2:09

2 Answers 2

0

Sadly, this feature is not yet available in the Positron IDE.

But I have found this helpful extension called Python Snippets 3 (Pro), which when installed gives you an option of common python function which parentheses + parameters:

enter image description here
the autocomplete options include print with brackets and extra parameters too.

len autocompletes to
len(object)

int autocompletes to

int("")

And many more.

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

-2

Automatic parentheses insertion for Python functions in Positron IDE isn't currently available

You can Creating custom snippets for your most commonly used functions

  1. Go to File → Preferences → Configure User Snippets

  2. Select Python

  3. Add snippets like:

    {
      "len with parentheses": {
        "prefix": "len",
        "body": "len($0)",
        "description": "len() function with parentheses"
      }
    }
    

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.