Skip to content
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

Construct improvement #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Construct improvement #24

wants to merge 3 commits into from

Conversation

xvw
Copy link
Member

@xvw xvw commented Jan 20, 2025

It try to implement the behaviour described in #23

@xvw xvw requested review from voodoos and shonfeder January 20, 2025 11:34
Copy link

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

ocaml-eglot.el Show resolved Hide resolved
@voodoos
Copy link
Member

voodoos commented Jan 20, 2025

It's a bit fiddly isn't it ?
What if my cursor, | is just before the in keyword (without a space) ?

let x : int option = |in

Or just after the = ?

Also I would expect Merlin's recovery to use a typed hole in such situation, but I guess it gets a ghost location preventing it to be used by construct ?

@xvw
Copy link
Member Author

xvw commented Jan 20, 2025

@voodoos
I have tried some case and I do not see any wrong behaviour since if it can't generate hole, it just fail with "Not an Hole", so it is the same behaviour if we had to put a hole.

@voodoos
Copy link
Member

voodoos commented Jan 20, 2025

I still find this a bit too hacky and specific, but there no real harm coming from it. Feel free to merge.

@xvw
Copy link
Member Author

xvw commented Jan 20, 2025

I still find this a bit too hacky and specific, but there no real harm coming from it. Feel free to merge.

What do you think about making it configurable?

@xvw
Copy link
Member Author

xvw commented Jan 21, 2025

Hi @shonfeder

After some experimentation and a bit of thought about the control, I think there are several undesirable behaviors (such as the fact that automatic hole insertion doesn't trigger a buffer change event), so I think it would be better to let the user implement his own additional logic at the personal configuration level rather than at the mode level (using, for example, the code you referenced in the issue). So I suggest closing this ticket, is that ok with you? (In any case, thank you very much for your suggestion and feedback!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants