-
Notifications
You must be signed in to change notification settings - Fork 100
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
Autocomplete #10
Conversation
* We autocomplete the names of natives, loaded modules, and names in those modules. * Autocompletion inside a string autocompletes file names in the current directory.
This PR builds on #9 |
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use use
Review fixes for pull #10.
No description provided.