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

Autocomplete #10

Merged
merged 2 commits into from
Feb 21, 2018
Merged

Autocomplete #10

merged 2 commits into from
Feb 21, 2018

Conversation

joelburget
Copy link
Contributor

No description provided.

* We autocomplete the names of natives, loaded modules, and names in
  those modules.
* Autocompletion inside a string autocompletes file names in the current
  directory.
@bts
Copy link
Contributor

bts commented Feb 21, 2018

This PR builds on #9

@buckie buckie merged commit 68793ad into kadena-io:master Feb 21, 2018
src/Pact/Repl.hs Outdated
completeFn :: (MonadIO m, MonadState ReplState m) => CompletionFunc m
completeFn = completeQuotedWord (Just '\\') "\"" listFiles $
completeWord (Just '\\') ("\"\'" ++ filenameWordBreakChars) $ \str -> do
modules <- gets (^. rEnv . eeRefStore . rsModules)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use use

completeFn = completeQuotedWord (Just '\\') "\"" listFiles $
completeWord (Just '\\') ("\"\'" ++ filenameWordBreakChars) $ \str -> do
modules <- gets (^. rEnv . eeRefStore . rsModules)
let namesInModules = concat $ modules ^.. traverse . _2 . to HM.keys
Copy link
Contributor

@sirlensalot sirlensalot Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use toListOf (traverse . _2 . to HM.keys) $ modules.
to is dope though

completeFn :: (MonadIO m, MonadState ReplState m) => CompletionFunc m
completeFn = completeQuotedWord (Just '\\') "\"" listFiles $
completeWord (Just '\\') ("\"\'" ++ filenameWordBreakChars) $ \str -> do
modules <- gets (^. rEnv . eeRefStore . rsModules)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use use

joelburget added a commit to joelburget/pact that referenced this pull request Feb 22, 2018
sirlensalot pushed a commit that referenced this pull request Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants