Giter Site home page Giter Site logo

daylily-zeleen / gdscript-formatter Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 5.0 205 KB

An addons for formatting GDScript.

License: MIT License

GDScript 100.00%
addon formatter formatter-plugin gdformat gdscript gdscript-language gdtoolkit godot pip plugin python

gdscript-formatter's People

Contributors

akskokki avatar daylily-zeleen avatar leopeltola avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gdscript-formatter's Issues

Format on save is not working on 4.2.1

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.

No commands registered

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.

Exit code: 1

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.