intero 0.1.22 → 0.1.23
raw patch · 4 files changed
+39/−29 lines, 4 files
Files
- CHANGELOG +6/−0
- elisp/intero.el +21/−18
- intero.cabal +1/−1
- src/InteractiveUI.hs +11/−10
CHANGELOG view
@@ -1,3 +1,9 @@+0.1.23:+ * :cd handles quoted filepaths properly++0.1.22:+ * Support for :move and :sleep+ 0.1.20: * More robust name finding, fixes bug https://github.com/commercialhaskell/intero/issues/98
elisp/intero.el view
@@ -70,7 +70,7 @@ :group 'haskell) (defcustom intero-package-version- "0.1.22"+ "0.1.23" "Package version to auto-install. This version does not necessarily have to be the latest version@@ -504,7 +504,7 @@ (intero-with-dump-splices (let* ((output (intero-blocking-call 'backend- (concat ":l " (intero-localize-path (intero-temp-file-name)))))+ (concat ":load " (intero-localize-path (intero-temp-file-name))))) (msgs (intero-parse-errors-warnings-splices nil (current-buffer) output)) (line (line-number-at-pos)) (column (if (save-excursion@@ -623,10 +623,10 @@ (message "Reloading ...") (intero-async-call 'backend- ":l DevelMain"+ ":load DevelMain" (current-buffer) (lambda (buffer reply)- (if (string-match "^OK, modules loaded" reply)+ (if (string-match "^O[Kk], modules loaded" reply) (intero-async-call 'backend "DevelMain.update"@@ -659,8 +659,7 @@ 'interrupted) (let* ((file-buffer (current-buffer)) (staging-file (intero-localize-path (intero-staging-file-name)))- (temp-file (intero-localize-path (intero-temp-file-name)))- (hash (intero-check-calculate-hash)))+ (temp-file (intero-localize-path (intero-temp-file-name)))) ;; We queue up to :move the staging file to the target temp ;; file, which also updates its modified time. (intero-async-call@@ -672,14 +671,13 @@ ;; by the copy above. (intero-async-call 'backend- (concat ":l " temp-file)+ (concat ":load " temp-file) (list :cont cont :file-buffer file-buffer- :hash hash :checker checker) (lambda (state string) (with-current-buffer (plist-get state :file-buffer)- (let* ((compile-ok (string-match "OK, modules loaded: \\(.*\\)\\.$" string))+ (let* ((compile-ok (string-match "O[Kk], modules loaded: \\(.*\\)\\.$" string)) (modules (match-string 1 string)) (msgs (intero-parse-errors-warnings-splices (plist-get state :checker)@@ -689,13 +687,12 @@ (let ((results (cl-remove-if (lambda (msg) (eq 'splice (flycheck-error-level msg))) msgs)))- (setq intero-check-last-hash (plist-get state :hash)- intero-check-last-results results)+ (setq intero-check-last-results results) (funcall (plist-get state :cont) 'finished results)) (when compile-ok (intero-async-call 'backend- (concat ":m + "- (replace-regexp-in-string modules "," ""))+ (concat ":module + "+ (replace-regexp-in-string "," "" modules)) nil (lambda (_st _)))))))) ;; We sleep for at least one second to allow a buffer period@@ -1117,7 +1114,7 @@ (intero-with-repl-buffer prompt-options (comint-simple-send (get-buffer-process (current-buffer))- (concat ":l " file))+ (concat ":load " file)) (setq intero-repl-last-loaded file)))) (defun intero-repl-eval-region (begin end &optional prompt-options)@@ -1727,7 +1724,7 @@ "\n$" "" (intero-blocking-call 'backend- (format ":i %s" thing)))))+ (format ":info %s" thing))))) (if (string-match "^<interactive>" optimistic-result) ;; Load the module Interpreted so that we get information, ;; then restore bytecode.@@ -1739,7 +1736,7 @@ (unless (member 'save flycheck-check-syntax-automatically) (intero-async-call 'backend- (concat ":l " (intero-localize-path (intero-temp-file-name)))))+ (concat ":load " (intero-localize-path (intero-temp-file-name))))) (intero-async-call 'backend ":set -fobject-code")@@ -1747,7 +1744,7 @@ "\n$" "" (intero-blocking-call 'backend- (format ":i %s" thing))))+ (format ":info %s" thing)))) optimistic-result))) (defun intero-get-loc-at (beg end)@@ -2386,7 +2383,12 @@ (lambda (&rest ignore) (exit-recursive-edit)) "C-c C-c")- (widget-insert (propertize " to apply these choices.\n\n" 'face 'font-lock-comment-face))+ (widget-insert (propertize " to apply these choices, or hit " 'face 'font-lock-comment-face))+ (widget-create 'push-button :notify+ (lambda (&rest ignore)+ (abort-recursive-edit))+ "C-c C-k")+ (widget-insert (propertize " to cancel.\n\n" 'face 'font-lock-comment-face)) (let* ((me (current-buffer)) (choices (mapcar (lambda (option) (append option (list :value (plist-get option :default))))@@ -2414,6 +2416,7 @@ (let ((map (copy-keymap widget-keymap))) (define-key map (kbd "C-c C-c") 'exit-recursive-edit) (define-key map (kbd "C-c C-k") 'abort-recursive-edit)+ (define-key map (kbd "C-g") 'abort-recursive-edit) map)) (widget-setup) (recursive-edit)
intero.cabal view
@@ -1,7 +1,7 @@ name: intero version:- 0.1.22+ 0.1.23 synopsis: Complete interactive development program for Haskell license:
src/InteractiveUI.hs view
@@ -237,10 +237,10 @@ ("browse", keepGoing' (browseCmd False), completeModule), ("browse!", keepGoing' (browseCmd True), completeModule), ("extensions", keepGoing' extensionsCmd, completeModule),- ("cd", keepGoing' changeDirectory, completeFilename),- ("move", keepGoing' moveCommand, completeFilename),+ ("cd", keepGoingPaths changeDirectory, completeFilename),+ ("sleep", keepGoing' sleepCommand, noCompletion),- ("cd-ghc", keepGoing' changeDirectoryGHC, completeFilename),+ ("cd-ghc", keepGoingPaths changeDirectoryGHC, completeFilename), ("check", keepGoing' checkModule, completeHomeModule), ("continue", keepGoing continueCmd, noCompletion), ("complete", keepGoing completeCmd, noCompletion),@@ -266,6 +266,7 @@ ("load", keepGoingPaths loadModule_, completeHomeModuleOrFile), ("list", keepGoing' listCmd, noCompletion), ("module", keepGoing moduleCmd, completeSetModule),+ ("move", keepGoing' moveCommand, completeFilename), ("main", keepGoing runMain, completeFilename), ("print", keepGoing printCmd, completeExpression), ("quit", quit, noCompletion),@@ -1414,14 +1415,14 @@ ----------------------------------------------------------------------------- -- :cd -changeDirectory :: String -> InputT GHCi ()-changeDirectory "" = do+changeDirectory :: [FilePath] -> InputT GHCi ()+changeDirectory [] = do -- :cd on its own changes to the user's home directory either_dir <- liftIO $ tryIO getHomeDirectory case either_dir of Left _e -> return ()- Right dir -> changeDirectory dir-changeDirectory dir = do+ Right dir -> changeDirectory [dir]+changeDirectory (dir:_) = do graph <- GHC.getModuleGraph when (not (null graph)) $ liftIO $ putStrLn "Warning: changing directory causes all loaded modules to be unloaded,\nbecause the search path has changed."@@ -1447,12 +1448,12 @@ -- NOTE: calling :cd will reset the GHC working directory as well as -- the GHCi working directory.-changeDirectoryGHC :: String -> InputT GHCi ()+changeDirectoryGHC :: [FilePath] -> InputT GHCi () -- :cd-ghc on its own resets the ghc work directory to match -- the ghci work directory.-changeDirectoryGHC "" = lift $ modifyGHCiState $ \state ->+changeDirectoryGHC [] = lift $ modifyGHCiState $ \state -> state { ghc_work_directory = (ghci_work_directory state) }-changeDirectoryGHC dir = do+changeDirectoryGHC (dir:_) = do dir' <- expandPath dir lift $ modifyGHCiState $ \state -> state { ghc_work_directory = dir' }