pragmagic/vscode-nim

Formatting not working

Opened this issue · 7 comments

Just installed nim to give it a try.

Command 'Format Document' resulted in an error (An unknown error occurred. Please consult the log for more details.)

From the logs,

[2020-06-20 00:22:29.215] [exthost] [error] [kosz78.nim] provider FAILED
[2020-06-20 00:22:29.215] [exthost] [error] undefined

I'm also unable to get formatting to work with VSCode complaining no formatter is installed for nim. Using choosenim and:

$ nim -v
Nim Compiler Version 1.2.4 [MacOSX: amd64]
Compiled at 2020-07-16
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release
$ choosenim -v
choosenim v0.6.0 (2020-03-06 18:25:57) [macosx/amd64]
$ choosenim show
  Selected: 1.2.4
   Channel: stable
      Path: /Users/danawoodman/.choosenim/toolchains/nim-1.2.4

I had the same issue on MacOS catalina, code formatting did not work at all.

Debugging the extension, getNimPrettyExecPath() pointing to the correct path /usr/local/bin/nimpretty.
Repackaged as VSIX file and installed it the formatting worked nicely.

After i remove and reinstall the extension again, suddenly it works like nothing wrong happened.
Kinda wierd tho.

Any progress on this? I have the same issue

As a workaround you can install 0.6.4 (click on the cog next to the extension and choose "Install another version")

This seems to be an issue introduced in 0.6.5

@platoff @endragor any chance you might accept PRs for fixing this?

Note that this is fixed by #154

I have the same problem.