Mods / Prettier Vintage Story

Category: #Utility
Author: Rhoun
Side: Both
Created: May 22nd at 4:58 PM
Last modified: May 22nd at 5:00 PM
Downloads: 93
Follow Unfollow 6

Latest version:
prettier-vs.zip


This version of prettier produces a more compact JSON that is still readable by using one-line objects when it is no longer than 'printWidth' in config (80 by default).

Please check the GitHub readme for instructions on how to use this with different IDEs/editors, and how to change maximum width.

Let me know if you have any ideas or if something doesn't work.

Enjoy!

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1
93 May 22nd at 5:00 PM Show prettier-vs.zip

11 Comments (oldest first | newest first)

💬 RhounAuthor, May 28th at 2:00 AM

If you encounter this more than with that one comment, please let me know, and I'll try to look into this once more. RogueRaiden

💬 RogueRaiden, May 26th at 9:07 PM

really just that the only comment even causing issue was the "//chase" comment, i dont have any idea why lol
of course simply removing the comment will resolve it not formatting. heck it might even go away on its own at some point

💬 RhounAuthor, May 26th at 12:43 PM

Interesting, but it doesn't happen for me at all, and I even tried to install vscodium and check there - it formats the document without any problem, even if I move comments around.

I wonder what I could be missing here, did you notice anything else that can be of use? I wonder if there was some special symbol or something similar that managed to get in the way.

 

RogueRaiden

💬 RogueRaiden, May 26th at 2:03 AM

https://pastebin.com/wG3rcR5Y

so somehow only the second comment //chase causes the error. the first, third and fourth comments in the file dont cause the error

💬 RhounAuthor, May 25th at 10:48 PM

I probably didn't check how it handles comments at all. Can you please provide a sample file where it fails? RogueRaiden

💬 RogueRaiden, May 25th at 8:36 PM

so im getting this error sometimes with //comments added in my json files and it wont format any part of the file (the comment in this particular error was //chase )
its interesting that it doesnt error with some other comments i have in other json files

Error: Comment "chase" was not printed. Please report this error!
at ensureAllCommentsPrinted (file:///home/Matt/Rogue%20House%20Workshop/Vintage%20Story%20Folder/External%20Tools/Prettier%20VS/prettier-vs/index.mjs:20038:13)
at printAstToDoc (file:///home/Matt/Rogue%20House%20Workshop/Vintage%20Story%20Folder/External%20Tools/Prettier%20VS/prettier-vs/index.mjs:20860:3)
at async coreFormat (file:///home/Matt/Rogue%20House%20Workshop/Vintage%20Story%20Folder/External%20Tools/Prettier%20VS/prettier-vs/index.mjs:21213:14)
at async formatWithCursor (file:///home/Matt/Rogue%20House%20Workshop/Vintage%20Story%20Folder/External%20Tools/Prettier%20VS/prettier-vs/index.mjs:21414:14)
at async Module.format2 (file:///home/Matt/Rogue%20House%20Workshop/Vintage%20Story%20Folder/External%20Tools/Prettier%20VS/prettier-vs/index.mjs:22799:25)
💬 RhounAuthor, May 24th at 1:19 PM

Great, I'm happy it works for you now!

Yeah, the absolute path works the best, so you can have this version of prettier somewhere global and freely reuse it across different mod projects.

Please let me know if you encounter any issues or have any ideas for further tailoring this thing to VS modding.

RogueRaiden

 

💬 RogueRaiden, May 24th at 12:46 PM

Rhoun
Ahh i had no idea what i was supposed to do so thats what i tried first and it looked like it would be its own plugin (it shows up in extentions like it is when i put it into the extentions folder with a description and all, just with that error i said)

ohhhh i see, this is like another "node_modules" entry within the prettier extention

I believe i have it set correctly now, but it doesnt look like it does anything different than normal prettier? should i increase the printWidth from 80 to 120?

Edit: oh wait, now ive got it set correctly. a relative path like the Prettier extention used as an example didnt change it. but an absolute path did it correctly.

This is amazing!! thank you for this extension extension!

💬 RhounAuthor, May 24th at 12:25 PM

The provided file is not an extension itself, so you need to install the prettier extension, then there's this setting in the extension config "Prettier: Prettier Path".

Set it to point for the prettier-vs folder, e.g. F:/prettier-vs. You can also change the print width in the same settings window, and it'll work from there, so there is no need for an additional config file just for width.

RogueRaiden

 

💬 RogueRaiden, May 24th at 3:21 AM

trying to use with VSCodium (fork of VSCode) it doesnt load and gives this error:

"property engine.vscode is mandatory and must be of type string"

💬 DUCATISLO, May 23rd at 3:24 PM

gg

(edit comment delete)