Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support code formatting #79

Closed
ghost opened this issue Feb 10, 2018 · 10 comments
Closed

Support code formatting #79

ghost opened this issue Feb 10, 2018 · 10 comments

Comments

@ghost
Copy link

ghost commented Feb 10, 2018

It would be very nice, if formatting code would be supported, when pressing CTRL+Shift+P and than on format document (resp. the direct combination).

For example:

var x:int=2   
echo     x

should be formatted to something like

var x: int = 2
echo x
@lppedd
Copy link

lppedd commented Feb 23, 2018

This one would be nice!

@ghost
Copy link
Author

ghost commented Feb 24, 2018

Just saw that there is something in development similar to nimsuggest: https://github.com/nim-lang/Nim/blob/devel/tools/nimpretty.nim

@kosz78
Copy link
Collaborator

kosz78 commented Feb 25, 2018

I will try add nimpretty tools invocation in vscode

kosz78 added a commit that referenced this issue Feb 26, 2018
@ghost
Copy link
Author

ghost commented Mar 24, 2018

Thank you very much for your work on this.
When the marketplace version is updated I will test it :-)

@ghost
Copy link

ghost commented Jun 5, 2018

AFAIK nimpretty is not yet complete and should not be used as it can cause problems.

@ghost
Copy link
Author

ghost commented Oct 1, 2018

I have the latest version of nim (windows x64), nimpretty and this plugin installed, and an option to format the document is in the context menu, but when I click on it, it doesn't do something.
I manually tested nimpretty using nimpretty file.nim and this works and it's in path.
I also tried to change the filename to nimpretty2 and restarted vscode, then I get a warning that the binary isn't found so it seems to find the binary.

I also tried to start vscode as admin, didn't change.

Edit: The log says I have an unknown error:
log.ts:171 ERR

technicallyagd added a commit to technicallyagd/vscode-nim that referenced this issue Oct 5, 2018
kosz78 pushed a commit that referenced this issue Oct 7, 2018
nimpretty actually formats code in-place now
@ghost
Copy link
Author

ghost commented Oct 7, 2018

It works!

@ghost ghost closed this as completed Oct 7, 2018
@girng
Copy link

girng commented Oct 3, 2019

@Tim-St where are you finding that nimpretty executable? I can't find it with the latest windows build zip

@ghost
Copy link
Author

ghost commented Oct 4, 2019

@girng I've compiled it myself. I think there was a nimpretty folder.

@girng
Copy link

girng commented Oct 4, 2019

@girng I've compiled it myself. I think there was a nimpretty folder.

Nice, I did that but then rage-quit last night because vscode still kept saying it couldn't find the nimpretty binary :/

Even when nimpretty is in my path and works when in the console.

This issue was closed.
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

No branches or pull requests

3 participants