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

repl: add completion preview #30907

Closed
wants to merge 12 commits into from

Commits on Dec 14, 2019

  1. repl: remove dead code

    The .scope command was used only in the old debugger. Since that's
    not part of core anymore it's does not have any use. I tried to
    replicate the expected behavior but it even results in just exiting
    the repl immediately when using the completion similar to the removed
    test case.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    19dac98 View commit details
    Browse the repository at this point in the history
  2. repl: simplify repl autocompletion

    This simplifies calling `filteredOwnPropertyNames()`. The context
    is not used in that function, so there's no need to call the function
    as such.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    c65f3f1 View commit details
    Browse the repository at this point in the history
  3. repl: simplify code

    This simplifies some repl code and removes a coe branch that is
    unreachable.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    ec47482 View commit details
    Browse the repository at this point in the history
  4. readline: update ansi-regex

    This updates the used regular expression to the latest version.
    It includes a number of additional escape codes.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    43ae689 View commit details
    Browse the repository at this point in the history
  5. repl,readline: refactor common code

    This renames some variables for clarity and moves the common substring
    part into a shared file. One algorithm was more efficient than the
    other but the functionality itself was identical.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    1426e6c View commit details
    Browse the repository at this point in the history
  6. repl,readline: refactor for simplicity

    This just refactors code without changing the behavior. Especially
    the REPL code is difficult to read and deeply indented. This reduces
    the indentation to improve that.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    42d3590 View commit details
    Browse the repository at this point in the history
  7. repl: improve completion

    This improves the completion output by removing the nested special
    handling. It never fully worked as expected and required a lot of
    hacks to even keep it working halfway reliable. Our tests did not
    cover syntax errors though and those can not be handled by this
    implementation. Those break the layout and confuse the REPL.
    
    Besides that the completion now also works in case the current line
    has leading whitespace.
    
    Also improve the error output in case the completion fails.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    ca14259 View commit details
    Browse the repository at this point in the history
  8. repl: add completion preview

    This improves the already existing preview functionality by also
    checking for the input completion. In case there's only a single
    completion, it will automatically be visible to the user in grey.
    If colors are deactivated, it will be visible as comment.
    
    This also changes some keys by automatically accepting the preview
    by moving the cursor behind the current input end.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    1cbef42 View commit details
    Browse the repository at this point in the history
  9. repl: fix preview bug in case of long lines

    This addresses an issue that is caused by lines that exceed the
    current window columns. That would cause the preview to confuse the
    REPL. This is meant as hot fix. The preview should be able to handle
    these cases appropriately as well later on.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    707cba4 View commit details
    Browse the repository at this point in the history
  10. test: add multiple repl preview tests

    This improves the coverage for the preview feature signficantly.
    Quite a few edge cases get testet here to prevent regressions.
    BridgeAR committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    ca4c894 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0cd4153 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2138fd7 View commit details
    Browse the repository at this point in the history