-
Notifications
You must be signed in to change notification settings - Fork 27
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 for formatting #9
Comments
Hi, |
Something like formatting with a pretty printer etc... |
Oh, this functionality is already implemented. You can access it via the built in vscode keybinds (Shift + Alt + F on Windows) |
Hello, Just have tried it it seems having two problems:
Could you improve it? |
Hi,
Cheers |
Hi,
|
Ok, I have firgure out what it is: Because of the first problem, my lua file gets much less lines after formatting, however, the cursor stays always on the same position. I think it's a bug, since in your video it's not the case. |
I tested again, it seems context related, I work on a simple code like yours it work correctly, but not on my own real project: for example this one: https://github.com/Enzojz/flying_junction_1/blob/master/res/scripts/junction_assoc.lua I am not sure but perhaps that may caused by unicode letters in the file. |
I looked into it a bit, and its more than likely because |
Not sure, since I have tested again on another file, which isn't with any unicode letter, it worked fine. https://github.com/Enzojz/flying_junction_1/blob/master/res/scripts/junction.lua Just for information. |
Thanks for the use-cases; I'll use them when implementing diff support. You can follow #10 and trixnz/lua-fmt#13 to keep track of progress. Apologies for the bugs! |
Ok. Thank you. |
The new version on the marketplace (0.6.2) should fix this for you. Be advised though, the first format you run may not preserve the cursor position if the file has not been formatted before, as the number of edits will be fairly large and vscode loses track. After that though, the cursor should stay with you through formats so long as the file is reasonably close to the same layout that |
Thank you. Could you have a look into line breaking issue. |
Hello,
Is it possible to add support to make automatic formatting? Thanks !
best regards,
Zheng
The text was updated successfully, but these errors were encountered: