Bug 28727 - add context-sensitive completion
Summary: add context-sensitive completion
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: ada (show other bugs)
Version: unknown
: P2 enhancement
Target Milestone: 13.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-26 17:48 UTC by Tom Tromey
Modified: 2022-04-04 18:53 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2021-12-26 17:48:39 UTC
C++ and Rust have a feature where an expression like:
"print object.<TAB>" will only complete field names of "object".
Ada is missing this feature, but it could be added.
Comment 1 Tom Tromey 2022-02-22 15:11:20 UTC
It should also be possible to complete attribute names,
like "print x'ad<TAB>" -> "x'address".
Comment 2 Tom Tromey 2022-02-24 21:32:14 UTC
I have some patches.
Comment 4 Sourceware Commits 2022-04-04 18:51:02 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d4da1b2c1b7b85968da608dde03e054cc0b1f7ca

commit d4da1b2c1b7b85968da608dde03e054cc0b1f7ca
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Feb 22 13:12:02 2022 -0700

    Add context-sensitive field name completion to Ada parser
    
    This updates the Ada expression parser to implement context-sensitive
    field name completion.  This is PR ada/28727.
    
    This is somewhat complicated due to some choices in the Ada lexer --
    it chooses to represent a sequence of "."-separated identifiers as a
    single token, so the parser must partially recreate the completer's
    logic to find the completion word boundaries.
    
    Despite the minor warts in this patch, though, it is a decent
    improvement.  It's possible that the DWARF reader rewrite will help
    fix the package completion problem pointed out in this patch as well.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28727
Comment 5 Tom Tromey 2022-04-04 18:53:23 UTC
Fixed.