Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
af9b7283
Commit
af9b7283
authored
Dec 17, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gibiansky/IHaskell
parents
3cdc9e61
cafd410a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
Main.hs
main/Main.hs
+16
-5
No files found.
main/Main.hs
View file @
af9b7283
...
...
@@ -26,8 +26,9 @@ import System.Environment (setEnv)
#
endif
import
System.Posix.Signals
import
qualified
Data.Map
as
Map
import
Data.String.Here
(
hereFile
)
import
qualified
Data.Text.Encoding
as
E
import
Data.List
(
break
)
import
Data.List
(
break
,
last
)
-- IHaskell imports.
import
IHaskell.Convert
(
convert
)
...
...
@@ -305,12 +306,22 @@ replyTo interface req@ExecuteRequest { getCode = code } replyHeader state = do
,
status
=
Ok
})
-- Always assume that the code is complete, which allows for only
-- single line inputs for now.
replyTo
_
IsCompleteRequest
{}
replyHeader
state
=
do
let
reply
=
IsCompleteReply
{
header
=
replyHeader
,
reviewResult
=
CodeComplete
}
-- Check for a trailing empty line. If it doesn't exist, we assume the code is incomplete,
-- otherwise we assume the code is complete. Todo: Implement a mechanism that only requests
-- a trailing empty line, when multiline code is entered.
replyTo
_
req
@
IsCompleteRequest
{}
replyHeader
state
=
do
isComplete
<-
isInputComplete
let
reply
=
IsCompleteReply
{
header
=
replyHeader
,
reviewResult
=
isComplete
}
return
(
state
,
reply
)
where
isInputComplete
=
do
let
code
=
lines
$
inputToReview
req
if
nub
(
last
code
)
==
" "
then
return
CodeComplete
else
return
$
CodeIncomplete
$
indent
4
indent
n
=
take
n
$
repeat
' '
replyTo
_
req
@
CompleteRequest
{}
replyHeader
state
=
do
let
code
=
getCode
req
pos
=
getCursorPos
req
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment