daylily-zeleen / gdscript-formatter Goto Github PK
View Code? Open in Web Editor NEWAn addons for formatting GDScript.
License: MIT License
An addons for formatting GDScript.
License: MIT License
If "Format on save" is enabled in the preferences, the code is not formatted on save and the following message "Format on save failed: due to engine bug. Please report an issue." is displayed in the output window.
Tested on Godot 4.2.1 standard version.
Note that the "Format on Save" plugin work well (no issue), and it can be used in replacement of the same feature of this plugin.
Hi!
I am working on Godot 4.2.1 stable, and I downloaded your formatter plugin from the AssetLib (ver 0.0.4). After enabling it in the Project Settings > Plugins, there's no command as described in the README file showing up in the command palette nor in the menu Project > Tools. Moreover, when trying to disable the plugin, it prints this error message below:
The Command 'GDScript Formatter/Format GDScript' doesn't exists. Unable to remove it.
可以支持一下这个功能吗?
Thank you for developing this addon.
I was able to install it successfully:
-- Begin install gdtoolkit.
-- Install gdtoolkit successfully.
But I get the following when I try to format a trivial sample script:
Exit code: 1
Format GDScript failed: res://main.gd
This is the script:
extends Node
@onready var weapon = $Player/Weapon
enum Align {Horizontal, Vertical}
@export var align = Align.Horizontal
var health = 100
func _ready():
$Label.text = "hello world"
$Label.modulate = Color.SEA_GREEN
print(align)
var a = [1,2,3]
print(a)
var b = {"ds":2, 2:1}
print(b)
func _input(event):
if event.is_action_pressed("my_action"):
$Label.modulate = Color.DARK_RED
jump(health)
if event.is_action_released("my_action"):
$Label.modulate = Color.SEA_GREEN
func jump(amount):
print(amount)
There must be something obvious that I'm missing here. Apologies if this is a dumb question.
More messages.
I just restarted Gogot and got the following:
Godot Engine v4.2.2.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
modules/gltf/register_types.cpp:63 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
The Command 'GDScript Formatter/Format GDScript' doesn't exists. Unable to remove it.
GDScript Formatter: The command "gdformat" can't be found in your envrionment.
I got the errors below after I doing this: Project->Tool->GDScript Formatter: Install/Update gdtoolkit
-- Begin install gdtoolkit.
-- Install gdtoolkit successfully.
This function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools) can only be accessed from either the main thread or a thread group. Use call_deferred() instead.
This function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools) can only be accessed from either the main thread or a thread group. Use call_deferred() instead.
Caller thread can't call this function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools/@MarginContainer@4047/@ScrollContainer@4048/@Control@4049). Use call_deferred() or call_thread_group() instead.
This function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools) can only be accessed from the main thread. Use call_deferred() instead.
Caller thread can't call this function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools). Use call_deferred() or call_thread_group() instead.
Caller thread can't call this function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools). Use call_deferred() or call_thread_group() instead.
This function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools) can only be accessed from the main thread. Use call_deferred() instead.
Caller thread can't call this function in this node (/root/@EditorNode@17147/@Panel@13/@VBoxContainer@14/@EditorTitleBar@15/@MenuBar@111/Project/Tools). Use call_deferred() or call_thread_group() instead.
But I get the message below if I do this again: Project->Tool->GDScript Formatter: Install/Update gdtoolkit
-- Begin install gdtoolkit.
-- Install gdtoolkit successfully.
But the format script command still exits with 1 and a fail.
Hopefully, this means something to you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.