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

add filename completion to pdb #58418

Closed
tshepang mannequin opened this issue Mar 6, 2012 · 12 comments
Closed

add filename completion to pdb #58418

tshepang mannequin opened this issue Mar 6, 2012 · 12 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@tshepang
Copy link
Mannequin

tshepang mannequin commented Mar 6, 2012

BPO 14210
Nosy @birkenfeld
Files
  • pdb-completion.diff
  • pdb-completion-v2.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/birkenfeld'
    closed_at = <Date 2012-03-10.21:36:54.054>
    created_at = <Date 2012-03-06.15:36:47.265>
    labels = ['type-feature', 'library']
    title = 'add filename completion to pdb'
    updated_at = <Date 2012-03-10.21:36:54.053>
    user = 'https://bugs.python.org/tshepang'

    bugs.python.org fields:

    activity = <Date 2012-03-10.21:36:54.053>
    actor = 'python-dev'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2012-03-10.21:36:54.054>
    closer = 'python-dev'
    components = ['Library (Lib)']
    creation = <Date 2012-03-06.15:36:47.265>
    creator = 'tshepang'
    dependencies = []
    files = ['24767', '24769']
    hgrepos = []
    issue_num = 14210
    keywords = ['patch']
    message_count = 12.0
    messages = ['155020', '155220', '155222', '155242', '155247', '155249', '155250', '155251', '155252', '155254', '155255', '155352']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'tshepang', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue14210'
    versions = ['Python 3.3']

    @tshepang
    Copy link
    Mannequin Author

    tshepang mannequin commented Mar 6, 2012

    This would be extra nice because I would not have to fill in the entire path manually when I'm setting a b(reak).

    @tshepang tshepang mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 6, 2012
    @birkenfeld
    Copy link
    Member

    I agree. It should not be too hard to add complete_break() and other similar methods that do this to Pdb.

    @birkenfeld
    Copy link
    Member

    Here's a patch for 3.3, adding completion to most commands (either completes locations, breakpoint numbers or expressions). Please test!

    @birkenfeld birkenfeld self-assigned this Mar 9, 2012
    @tshepang
    Copy link
    Mannequin Author

    tshepang mannequin commented Mar 9, 2012

    Thanks for the work.

    I see that completion now works for user-defined variables, but:

    • completing with 'b' doesn't work at all
    • completing with 'break' only completes the first directory that gets the TAB key
    • also, 'break' doesn't complete when I do another try to do auto-completion (works only on first try)

    @birkenfeld
    Copy link
    Member

    I see that completion now works for user-defined variables, but:

    • completing with 'b' doesn't work at all

    Right, that needs to be added for every shortcut.

    • completing with 'break' only completes the first directory that gets the TAB key
    • also, 'break' doesn't complete when I do another try to do auto-completion (works only on first try)

    Indeed. That should be fixed with this new version of the patch.

    @tshepang
    Copy link
    Mannequin Author

    tshepang mannequin commented Mar 9, 2012

    Works much better, but there are still some issues:

    • using relative path completes, but I get something like "'../prog.py' not found from sys.path"
    • using "~/" to try to complete the HOME directory doesn't work... it completes the root directory

    @birkenfeld
    Copy link
    Member

    • using relative path completes, but I get something like "'../prog.py' not found from sys.path"

    That has nothing to do with the completion.

    • using "~/" to try to complete the HOME directory doesn't work... it completes the root directory

    Since break doesn't accept "~", I don't see why it should complete it. Keep in mind it's not a shell :)

    @tshepang
    Copy link
    Mannequin Author

    tshepang mannequin commented Mar 9, 2012

    Georg Brandl <georg@python.org> added the comment:
    > * using relative path completes, but I get something like "'../prog.py' not found from sys.path"
    That has nothing to do with the completion.

    If I give it an absolute path it works, hence the complaint.

    > * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory
    Since break doesn't accept "~", I don't see why it should complete it.  Keep in mind it's not a shell :)

    Fair enough. Perhaps the completion should not be when encountering
    that character?

    @birkenfeld
    Copy link
    Member

    >> * using relative path completes, but I get something like "'../prog.py' not found from sys.path"
    > That has nothing to do with the completion.
    If I give it an absolute path it works, hence the complaint.

    But that has to do with how relative paths are handled, not with how they are entered: they are taken relative to sys.path[0]. I don't know why, and if that is the useful thing to do, but it's for another issue.

    >>> * using "~/" to try to complete the HOME directory doesn't work... it completes the root directory
    >> Since break doesn't accept "~", I don't see why it should complete it.  Keep in mind it's not a shell :)
    > Fair enough. Perhaps the completion should not be when encountering
    that character?

    That should be easy to do, yes.

    @tshepang
    Copy link
    Mannequin Author

    tshepang mannequin commented Mar 9, 2012

    But that has to do with how relative paths are handled, not with how they are entered: they are taken relative to sys.path[0]. I don't know why, and if that is the useful thing to do, but it's for another issue.

    Perhaps refuse to complete all relative paths as well?

    @birkenfeld
    Copy link
    Member

    Nope, don't think so. They are accepted and handled (albeit strangely) after all.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 10, 2012

    New changeset 01a25f638c83 by Georg Brandl in branch 'default':
    Close bpo-14210: add command argument completion to pdb: complete file names, global/local variables, aliases
    http://hg.python.org/cpython/rev/01a25f638c83

    @python-dev python-dev mannequin closed this as completed Mar 10, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant