Case splitting works in Emacs!
This commit is contained in:
parent
40cd5b7deb
commit
3ef1979f67
@ -257,7 +257,7 @@ sig opt file lineNo colNo = ghandle handler body
|
||||
modSum <- Gap.fileModSummary file
|
||||
sigTy <- getSignature modSum lineNo colNo
|
||||
case sigTy of
|
||||
Nothing -> return ""
|
||||
Nothing -> return $ convert opt ([] :: [String])
|
||||
Just (Signature loc names ty) -> do
|
||||
return $ convert opt $ ( "function"
|
||||
, fourInts loc
|
||||
|
@ -23,14 +23,17 @@
|
||||
(let ((info (ghc-obtain-case-split)))
|
||||
(if (null info)
|
||||
(message "Cannot split in cases")
|
||||
(let ((varinfo (car info))
|
||||
(declinfo (cadr info))
|
||||
(cases (caddr info)))
|
||||
(message cases)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((current-line (line-number-at-pos))
|
||||
(begin-line (ghc-sinfo-get-beg-line info))
|
||||
(begin-line-diff (+ 1 (- begin-line current-line)))
|
||||
(begin-line-pos (line-beginning-position begin-line-diff))
|
||||
(begin-pos (- (+ begin-line-pos (ghc-sinfo-get-beg-column info)) 1))
|
||||
(end-line (ghc-sinfo-get-end-line info))
|
||||
(end-line-diff (+ 1 (- end-line current-line)))
|
||||
(end-line-pos (line-beginning-position end-line-diff))
|
||||
(end-pos (- (+ end-line-pos (ghc-sinfo-get-end-column info)) 1)) )
|
||||
(delete-region begin-pos end-pos)
|
||||
(insert (ghc-sinfo-get-info info)) ) )))
|
||||
|
||||
(defun ghc-obtain-case-split ()
|
||||
(let* ((ln (int-to-string (line-number-at-pos)))
|
||||
|
Loading…
Reference in New Issue
Block a user