Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fsharp/emacs-fsharp-mode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: jdodds/emacs-fsharp-mode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: inferior-fsharp-tab-completion
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 9, 2019

  1. Tell comint to set TERM=emacs for fsi, and don't force using a pipe

    We want to be able to use fsi's tab-completion, but we can't if we have
    to pass --readline- as it turns off readline support. comint reports itself
    as a dumb-terminal by default, which causes fsi to treat it like one. Setting
    TERM=emacs (or likely and value that's not 'dumb') appears to let us interact
    with fsi in the way we want to.
    
    The previous combination of (process-connection-nil) and setting --readline- was
    probably done to get around fsi's behavior when using a pty and TERM=dumb, but Im
    not 100% sure of that.
    
    This setup for init-ing the inferior fsharp process might need revisted in the future.
    jdodds committed Mar 9, 2019
    Configuration menu
    Copy the full SHA
    abd533a View commit details
    Browse the repository at this point in the history
  2. First attempt at tab completion for inferior fsharp

    This is a start at implementing tab completion for inferior fsharp buffers
    through comint-redirect style process filters. The completion process is as
    follows:
    
    When inferior-fsharp-get-completion is triggered, we copy the input at the
    inferior fsharp prompt and clear the input. We then set up redirection of the
    inferior processes output via comint-redirect-setup, and set up a proess filter
    to check the output for our completion. Once we get output that looks like a
    completion, we grab it, send (length completion) backspaces to the
    inferior process to clear it's input buffer, remove our process filter, undo
    our redirection setup, return our completion back to the function that
    requested it, and insert it in the inferior fsharp prompt line.
    
    This is pretty awkward feeling due to needing to manage our buffer's prompt and
    fsi's input buffer seperately, hopefully that's not entirely unavoidable.
    
    Right now, this lacks a few things needed as a bare minimum to be acceptable,
    imo:
    
    + it currently assumes a completion will always be returned (easy to fix)
    
    + it needs to call (sleep-for) to ensure our output filters aren't deactivated
      before all the output from fsi has been received
    
    + it will only ever give the first completion -- the way fsi does it is to
      return subsequent members of completions on subsequent tab presses, we don't
      have a mechanism for handling this yet.
    
    The first point can probably be fixed just by looking for a bell in output or
    using a timeout, but the second two will require a more fleshed out solution for
    process/buffer communication.
    
    Need to read python-shell-completion-native and probably some other
    inferior-repl modes completion implementations for guidance.
    
    We also need to figure out how to write tests for this and write them before
    going much further here.
    jdodds committed Mar 9, 2019
    Configuration menu
    Copy the full SHA
    f589e6c View commit details
    Browse the repository at this point in the history
Loading