Skip to content

libgap: do not restrict libgap.<tab> completion to a fixed list #27923

@nthiery

Description

@nthiery

Since #19917, tab completion on libgap returns a fixed list. As noted there, new global functions and objects introduced when loading packages remain therefore hidden. Now that loading packages in libgap is much better supported, this is really becoming an issue.

Proposal, after discussion with GAP devs: use the same implementation as in the plain gap interface (namely ask GAP for the list of global names), without a cache.

Pros:

  • Principle of less surprise: keep plain GAP, Sage's gap and Sage's libgap consistent;

  • Follow the design decisions of GAP to take advantage of their expertise;

  • Supports loading packages and advertising their content (this support was postponed to a later ticket in Libgap tab completion #19917);

  • No need any more to maintain in Sage a list of "important" GAP functions.

  • With libgap, fetching the list of global GAP symbols is quasi instantaneous:

    sage: %time a = [str(x) for x in libgap.NamesSystemGVars()]
    CPU times: user 21.2 ms, sys: 0 ns, total: 21.2 ms
    Wall time: 20.9 ms
    

    Hence the implementation is simple; we need not worry about caching, invalidating the cache upon loading packages, ...

Con:

  • This makes for a larger tab completion list

CC: @vbraun @tscrim @dimpase @embray

Component: interfaces

Keywords: gap libgap

Issue created by migration from https://trac.sagemath.org/ticket/27923

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions