-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
When adding a comment block to the end of a file and hitting "enter" within the code block the files contents are cleared #1490
Comments
I can't reproduce, can others reproduce it? |
ah balls, I forgot I had a Sumneko plugin present. |
I reproduce this, by install the plugin. maybe the result of 'type on format' is handled by plugin mechanism, or error handling by plugin. |
So the plugin creator made a suggestion, which they believe shows its a Sumneko core issue and not a Plugin specific issue. I added a dummy plugin to my workspace, set the plugin path to this and the issue still occurred. Dummy plugin: root of workspace\plugin\plugin.lua
Set Sumneko to use this dummy plugin at the workspace settings level: I close VS Code, make the changes and then open it up clean. Reproduced issue with this dummy plugin active then used "undo" to return the code back to how it was at the fresh load. If I set my plugin path setting to be empty string |
I cannot reproduce it, did you triggered formatting? |
I can reproduce it with range formatting now. |
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Formatting
Expected Behaviour
That it doesn't clear the files content. No real action is required from the formatter during this action.
Actual Behaviour
That it's clearing the files contents.
Reproduction steps
Have a new file with some content, add a comment block to the end of the file and add a new line within the content block, the file is cleared.
I know its Sumneko as it doesn't happen when I disable the extension. It only started in the last version or 2.
Start with file content:
Press enter a few times to get some empty lines
Type
--[[
and it auto completes the closing]]
, leaving the cursor in the middle of the command block.Press enter to add a new line, with the intention of typing within the comment block. The file is cleared at this point.
Video of the issue occuring.

Additional Notes
No response
Log File
file_c%3A_Home_Projects_Factorio%20Modding_Factorio-JD-Plays.log
service.log
The text was updated successfully, but these errors were encountered: