radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
523 stars 74 forks source link

`void-variable file` from `apheleia--formatter-context` #225

Closed alternateved closed 9 months ago

alternateved commented 9 months ago

Hello. After changes introduced in https://github.com/radian-software/apheleia/pull/215 I've encountered below error:

Debugger entered--Lisp error: (void-variable file)
  eval(file)
  apheleia--formatter-context(prettier-typescript (npx "prettier" "--stdin-filepath" filepath "--parser=typescript" (apheleia-formatters-js-indent "--use-tabs" "--tab-width")) nil nil)
  apheleia--run-formatter-process((npx "prettier" "--stdin-filepath" filepath "--parser=typescript" (apheleia-formatters-js-indent "--use-tabs" "--tab-width")) #<buffer SomeTsFile.ts> nil #f(compiled-function (stdout) #<bytecode 0x1a809af184805f5>) nil prettier-typescript)
  apheleia--run-formatters((prettier-typescript) #<buffer SomeTsFile.ts> nil #f(compiled-function (formatted-buffer) #<bytecode -0x1840ef4db241010f>))
  apheleia-format-buffer((prettier-typescript) #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_17>)
  apheleia--format-after-save()
  run-hooks(after-save-hook)
  basic-save-buffer(t)
  save-buffer(1)
  funcall-interactively(save-buffer 1)
  command-execute(save-buffer)

I did not test it well enough yet, if there is anything else that I could add let me know.

leungbk commented 9 months ago

cc @mohkale

mohkale commented 9 months ago

Oopsie, guess it really is impossible to have a big refactoring without at least one bug. On the bright side this ones quick and easy. Please double check it's fixed with the latest commit on main and reopen if the issue persists. Sorry for the inconvenience.

alternateved commented 9 months ago

I've checked the latest commit and everything works great. Thanks a lot for your hard work!