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

Replace the current ElmFormat with a more lightweight version #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

naddeoa
Copy link

@naddeoa naddeoa commented Nov 6, 2016

I was running into a lot of issues with the current implementation of
the ElmFormat command. Whenever I would format my source code it would
kick off builds on my webpack dev server. In addition, when you have a
NERDTree window open along with a Tagbar window, there is a lot of
loading/unloading happening and all of the windows jump around.

This version of ElmFormat doesn't use any temporary files or write to
the file system, it just replaces the current buffer with the output of
elm-format. The error messages are not displayed in a particularly fancy
way, but the buffer change is represented in the undo history and in
practice the workflow is pretty functional: attempt to format, see the
error, undo and fix it. Sort of a light weight syntax check without
needing to use elm-make, which requires that imports are actually
resolved and you're in a proper project, etc.

I was running into a lot of issues with the current implementation of
the ElmFormat command. Whenever I would format my source code it would
kick off builds on my webpack dev server. In addition, when you have a
NERDTree window open along with a Tagbar window, there is a lot of
loading/unloading happening and all of the windows jump around.

This version of ElmFormat doesn't use any temporary files or write to
the file system, it just replaces the current buffer with the output of
elm-format. The error messages are not displayed in a particularly fancy
way, but the buffer change is represented in the undo history and in
practice the workflow is pretty functional: attempt to format, see the
error, undo and fix it. Sort of a light weight syntax check without
needing to use elm-make, which requires that imports are actually
resolved and you're in a proper project, etc.
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.

1 participant