google / vim-codefmt

Vim plugin for syntax-aware code formatting
Apache License 2.0
1.11k stars 114 forks source link

Fix dartfmt's IsAvailable() method. #225

Closed malcolmr closed 1 year ago

malcolmr commented 1 year ago

d927656 changed the dartfmt_executable flag from a string to a list, but didn't change the use inside IsAvailable(), leading to:

Failed to evaluate whether formatter dartfmt is available: Vim(return):E730: Using a List as a String

The change uses the ResolveFlagToArray() helper in both IsAvailable() and FormatRange() (which incidentally also allows defining the flag using a Function), and updates the documentation for all flags using ResolveFlagToArray() to use the same phrasing.

Fixes #190.

malcolmr commented 1 year ago

I'm not sure why the neovim tests are failing, but it doesn't seem to be due to this change. Unfortunately that looks like that failure also aborts the Vim tests, but those do pass locally.