Skip to content

repl: Tab completion issue when useGlobal is set to false #7353

Description

@princejwesley

Version: v6.1.0 , (master: v7.0.0-pre)
Platform: Darwin Princes-MacBook-Pro.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
Subsystem: repl

When useGlobal is set to false, Tab complete function returns fewer results.

// With useGlobal: true
Desktop 🙈 ₹ node
> I<<TAB>>
Infinity

Int16Array  Int32Array  Int8Array   Intl

> In

// With useGlobal: false
Desktop 🙈 ₹ cat test.js
const repl = require('repl');
repl.start({useGlobal: false});

Desktop 🙈 ₹ node test.js
> In<<TAB>> // expand to 'Infinity'

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    on Jun 21, 2016
  2. princejwesley commented on Jun 21, 2016

    @princejwesley
    ContributorAuthor
  3. addaleax commented on Jun 21, 2016

    @addaleax
    Member

    I’m still not sure if that is the right fix, but then again I’m not actually too familiar with how non-useGlobal REPLs are usually used outside of core.

    My first intuition would have been that implementing .scope by default could solve this (apparently that’s what the debugger REPL does?), but ultimately I can’t speak up for which approach would be the best one.

  4. addaleax commented on Jun 21, 2016

    @addaleax
    Member

    I’d still think that side effects of tab completion should be avoided as far as possible.

  5. lance commented on Jun 22, 2016

    @lance
    Member

    @princejwesley hope I'm not stepping on your toes here, but I think this is the better way to accomplish what you are trying to do. /cc @addaleax

  6. princejwesley commented on Jun 22, 2016

    @princejwesley
    ContributorAuthor

    @lance Please find my comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions