Copy + Paste multiple lines in gdscript causes compile error
When using GdScript and copy at least 2 lines of code and paste them somewhere else it cannot be compiled anymore due to the error “Used space character for indentation instead of tab as used before in the file”. If a single line is copied it works.
Is there a way to fix this or a workaround?
Please sign in to leave a comment.
Hello, Deftig ,
Could you please attach your Rider settings:
File | Settings | "Manage Layers" button at the bottom => "Export to File"in the context menu for each layer. Thanks in advance!I did what you said in 2024.3 EAP1 with each of the line appearing in this menu. I also attached a screenshot of the issue where just 2 lines were copied and pasted.
Upload ID: 2024_09_20_9cCKfcpHrsA8avo6xUhsCj
Thank you. The problem goes away when I set Settings | Editor | General | Typing Assistance | Auto-format on Paste to Indent and enable Settings | Editor | General | Typing Assistance | Smart indent on enter. Could you please check if these settings affect the behavior on your side?
These settings are like this by default but still it does not work for me. When pasting, the formatting messes up. Could it be related to a Windows setting or Windows language? If i paste 2 lines of code, the second line is indended for no reason but that's not the error as you could see on my previous uploaded screenshot, the first line already complains about formatting and there is no way to fix it but to delete it again and type it manually.
What do you have in the Tabs and Indents section in Settings | Editor | Code Style | GdScript? Those settings aren't included in the layered settings you've kindly exported before. Does toggling Use tab character help?
I can't repro with your layered settings, so perhaps you could also share your frontend IDE settings, exported via File | Manage IDE Settings | Export Settings… ?
The setting you are mentioning does not exist for me for some reason. I uploaded the export settings here:
Upload ID: 2024_09_20_WxqTRhZq4h6xffPF561sr4
I can't reproduce this anymore with Rider 2024.2.5 and GdScript plugin version 2.5.7. Could you please update both Rider and the plugin and check if you still observe the same issue?
Indeed it works with the GDScript Plugin from IceExplosive but my report was about the build-in Godot Support Plugin. Anyway i will use this plugin for now, thanks :)
Piggy backing on this topic that I found while Googling.
Will the built-in plugin for GDScript ever be updated to have proper Code Styles and everything else languages like C# have? Because unless I'm doing something terribly wrong, I can't find a way to have Rider insert 4 spaces instead of a <TAB> when hitting the TAB key.
There are no Code Style settings for GDScript
And if you uncheck the “Use tab character” here and save, it just isn't saved and Rider will continue to insert a <TAB> character anyway.
I tried manually changing this `true` to `false`, but that unfortunately also doesn't fix it.
While the user-made plug-in is good, it doesn't catch errors like these:
Are there any changes or updates planned to the official GDScript plugin that bring it up to par with other languages?
Niels Vaes We have a known issue of changing indents’ style for GDScript.
RIDER-116327 GDScript will only indent using tabs, not spaces
A workaround is using EditorConfig for the project. Enforce the
indent_stylein the editor config. Since GDScript support is still at an early stage, we need to collect use cases to implement more code styles for the language.