Skip to content

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