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

Make change timeout configurable, don't run typecheck if not needed #19

Merged
merged 2 commits into from
Oct 22, 2018

Conversation

MichaelXavier
Copy link
Contributor

This is for #17. It looks like there was already some intent expressed
in the code to not run the after change hook if
dhall-use-header-line was disabled, but it wasn't enacted when the
hook showed up. At first I thought I might just not register the hook
if dhall-use-header-line was disabled, but that would create
confusing behavior if the user live-configured their emacs to enable
that. So the hook will always fire but it will be a no-op if the type
won't be used.

Also for good measure I moved the timeout into an option so folks who
are having performance problems but don't want to completely abandon
buffer type can make a tradeoff in feedback cycle time for
responsiveness.

The motivation behind this is that on moderately large files, running
the type check every second makes any modification to the buffer
completely lock up. I'm happy to turn off the buffer type feature keep
the rest of the functionality like auto-reformatting and syntax
highlighting.

This is for psibi#17. It looks like there was already some intent expressed
in the code to not run the after change hook if
`dhall-use-header-line` was disabled, but it wasn't enacted when the
hook showed up. At first I thought I might just not register the hook
if `dhall-use-header-line` was disabled, but that would create
confusing behavior if the user live-configured their emacs to enable
that. So the hook will always fire but it will be a no-op if the type
won't be used.

Also for good measure I moved the timeout into an option so folks who
are having performance problems but don't want to completely abandon
buffer type can make a tradeoff in feedback cycle time for
responsiveness.

The motivation behind this is that on moderately large files, running
the type check every second makes any modification to the buffer
completely lock up. I'm happy to turn off the buffer type feature keep
the rest of the functionality like auto-reformatting and syntax
highlighting.
Copy link
Collaborator

@purcell purcell left a comment

Choose a reason for hiding this comment

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

Thanks for this. Looks good to me. Just needs the docstring tidying up as noted, please.

dhall-mode.el Outdated Show resolved Hide resolved
@purcell purcell merged commit 53e1fae into psibi:master Oct 22, 2018
@purcell
Copy link
Collaborator

purcell commented Oct 22, 2018

Awesome, thanks!

@MichaelXavier MichaelXavier deleted the timer-tuning branch October 22, 2018 22:44
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.

None yet

2 participants