Skip to content

PSCi: Support multiple command types in paste-mode - #3471

Merged
LiamGoodacre merged 1 commit into
purescript:masterfrom
LiamGoodacre:fix/psci-multicommand-paste
Dec 15, 2018
Merged

PSCi: Support multiple command types in paste-mode#3471
LiamGoodacre merged 1 commit into
purescript:masterfrom
LiamGoodacre:fix/psci-multicommand-paste

Conversation

@LiamGoodacre

Copy link
Copy Markdown
Member

Fixes #3454

E.g. you can paste an import and a declaration together:

Before

> :paste
… import Prelude
… foo = true
… ^D
(line 2, column 1):
unexpected "foo"
expecting "hiding", (, "as" or end of input
>

After

> :paste
… import Prelude
… foo = true
… ^D
>

@natefaubion natefaubion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems to do what it says on the tin!

_ -> parseRest psciCommand cmdString

parseRest :: P.TokenParser a -> String -> Either String a
parseRest :: P.TokenParser a -> String -> Either String [a]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR all looks great but I’m just slightly concerned about this change; I’m not sure it makes sense with all of the use sites. In particular should the places it’s used in parseDirective be changing? Unless I’m missing something, :browse Prelude Control.Bind will now queue two Browse commands, which seems a little odd to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah yes, this was unintentional. Thanks!

E.g. you can paste an import and a declaration together:

```
> :paste
… import Prelude
… foo = true
… ^D
>
```
@LiamGoodacre

Copy link
Copy Markdown
Member Author

@hdgarrood I think this is ready to look at again.

@hdgarrood hdgarrood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍

@LiamGoodacre
LiamGoodacre merged commit db0eb78 into purescript:master Dec 15, 2018
@LiamGoodacre
LiamGoodacre deleted the fix/psci-multicommand-paste branch December 15, 2018 14:26
@garyb garyb mentioned this pull request Jan 12, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants