Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Land within brackets/parentheses when autocompleting #21409

Open
2 tasks done
eode opened this issue Oct 9, 2023 · 2 comments
Open
2 tasks done

Land within brackets/parentheses when autocompleting #21409

eode opened this issue Oct 9, 2023 · 2 comments

Comments

@eode
Copy link

eode commented Oct 9, 2023

Issue Report Checklist

  • Searched the issues page for similar reports
  • [n/a] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [n/a] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [n/a] Could not reproduce inside jupyter qtconsole (if console-related)
  • [n/a] Tried basic troubleshooting (if a bug/error)
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Currently, when autocompleting, rather than landing inside the related parentheses, the cursor lands outside of the related parentheses. It would be nice to have an option to land within them.

What is the expected output? What do you see instead?

pathlib.Pa<tab>

# results in (| for cursor position)
pathlib.Path()|
# which requires immediate backtracking to use in the typical case (where one is sending arguments)

# It would be very nice indeed if there were an option for:
pathlib.Path(|)
# which results in immediate continuation

Versions

  • Spyder version: 5.4.3 (Conda)
  • Python version: Python 3.11.5 64-bit
  • Qt version: Qt 5.15.2
  • PyQt version: PyQt5 5.15.7
  • Operating System name/version:
    Linux 6.2.0-34-generic
@dalthviz
Copy link
Member

Hi there @eode sorry for such a late response and thank you for the feedback! Checked this with the latest Spyder release (6.0.4) on Linux and I was able to reproduce the described behavior. Interestingly when checking this on an env with Python 3.12 the cursor ends up inside the parentheses 🤔

Python 3.10 Python 3.12
Image Image

What do you think about this behavior @ccordoba12 ?

@ccordoba12
Copy link
Member

I think we should move the cursor to be inside the function/method parentheses when there are no code snippets for it (the difference with Python 3.12 that you found is due to the available code snippets for Path in that version).

@ccordoba12 ccordoba12 added this to the v6.x.x milestone Feb 12, 2025
@dalthviz dalthviz removed their assignment Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants