vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

Formatting not working

Open deklanw opened this issue 4 years ago • 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

deklanw avatar Jun 20 '20 04:06 deklanw

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

danawoodman avatar Jul 16 '20 04:07 danawoodman

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.

iambudi avatar Aug 25 '20 23:08 iambudi

Any progress on this? I have the same issue

NickSeagull avatar Sep 03 '20 16:09 NickSeagull

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

LiamDobbelaere avatar Sep 12 '20 07:09 LiamDobbelaere

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

NickSeagull avatar Sep 15 '20 11:09 NickSeagull

Note that this is fixed by #154

STaRDoGGCHaMP avatar Jan 13 '21 21:01 STaRDoGGCHaMP

I have the same problem.

hamidb80 avatar Feb 09 '21 15:02 hamidb80