bitwes / gut-extension Goto Github PK
View Code? Open in Web Editor NEWVSCode extension to run GUT from the editor.
License: MIT License
VSCode extension to run GUT from the editor.
License: MIT License
Could add a smart logging option that would do the follwoing:
Gut-extension: 2.2.0
Godot-tools: 2.0.0
Windows 10
Note: Careful when you'll test, I think there's something wrong with godot-tools' release. It says the version is 2.0.0 but I get this error, as if you last PR adding getGodotPath is not included:
2024-02-28 20:38:10.171 [error] Error: command 'godotTools.getGodotPath' not found
at k.n (vscode-file://vscode-app/c:/Users/Bob/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1587:12345)
at k.executeCommand (vscode-file://vscode-app/c:/Users/Bob/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1587:12274)
Anyhow, I installed it from their master branch: https://nightly.link/godotengine/godot-vscode-plugin/workflows/ci/master/godot-tools.zip
Now I get this error:
PS C:\Users\Bob\Desktop\GodotProjects\TestProjectVscode> "c:/Program Files (x86)/Steam/steamapps/common/Godot Engine/godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d
At line:1 char:93
+ ... amapps/common/Godot Engine/godot.windows.opt.tools.64.exe" -s res://a ...
+ ~~
Unexpected token '-s' in expression or statement.
At line:1 char:96
+ ... /godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'res://addons/gut/gut_cmdln.gd' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
I don't know by what cursed Powershell dark magic, but if I add an &
at the start it runs Gut correctly:
PS C:\Users\Bob\Desktop\GodotProjects\TestProjectVscode> & "c:/Program Files (x86)/Steam/steamapps/common/Godot Engine/godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d
PS C:\Users\Bob\Desktop\GodotProjects\TestProjectVscode> Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
Vulkan API 1.3.260 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 2070
--- Gut ---
[INFO]: using [C:/Users/Bob/AppData/Roaming/Godot/app_userdata/TestProjectVscode] for temporary output.
Godot version: 4.2.1
GUT version: 9.1.1
It appears that some change to VSCode has broken run-at-cursor. When used it runs all tests or sometimes just the script, but never just one test.
Windows 10
gut-extension v2.1.0
godot-tools v2.0.0 (master branch build)
When I run any Gut command, e.g. GUT: Run all
, I get this error: undefined -s res://addons/gut/gut_cmdln.gd -d
This creates the command string to run:
gut-extension/src/gut-tools.ts
Line 134 in 930ea4f
cmd
is declared here, so it means getRunGodotCommand()
returns undefined
gut-extension/src/gut-tools.ts
Line 132 in 930ea4f
I think the error might come from here, when I search my settings, none are called editor_path
Line 87 in 930ea4f
If I understand this file correctly, the godot_tools.editor_path
setting from extension godot-tools was split/renamed to godotTools.editorPath.godot3
and godotTools.editorPath.godot4
. Might have caused this issue.
Disable all pause_before_teardown
when running the entire suite. This saves from having to enable/disable it in the config.
I believe I've set up this extension correctly: I have Godot Tools installed, I've created the .gutconfig.json
file, and have set the godot_tools.editor_path
setting. The extension seems "activated" - the commands are showing up in the command prompt. However, when I try to run any of the 4 provided commands, I get this error (this is for GUT: Run All
):
There doesn't seem to be any additional info in the developer console. Any ideas what might be going on?
Versions:
The logic that determines the inner class for the cursor is pulling back all inner classes in the script. This means you cannot run a single test or inner class in any file that has any inner classes.
There appears to be a way to launch Godot from VSCode and connect the debugger. It would be great if this could do that as well.
I discovered gut extension for vscode this morning. I already use gut with editor so I have a .gut_editor_config.json.
I do not understand why I need to create a .gutconfig.json ? Because I just copy/paste my parameters from .gut_editor_config.json in it.
Another question, can I use .gut_editor_config.json instead of .gutconfig.json with vscode extension ?
PowerShell enabled via "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe"
in settings.json
Same problem with all commands, but using GUT: Show Help
as example.
Running the command will run
"D:\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gh
in the terminal resulting in this error:
At line:1 char:73
+ ... amapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://a ...
+ ~~
Unexpected token '-s' in expression or statement.
At line:1 char:76
+ ... ot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gh
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'res://addons/gut/gut_cmdln.gd' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
Taking the same command and prepending .
like this:
."D:\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gh
and running it manually works fine. (Not sure why, I'm new to PowerShell)
Another problem that pops up when fixing this is when running GUT: Run current script
it adds the -gselect=test_example.gd
parameter but gives this error from Gut:
--- Gut ---
Unrecognized options: [.gd]
Putting the filename in quotes: -gselect="test_example.gd"
fixes this too.
When using the debugger, it prints to the Debug Console. This is basically the same thing as "Output" tab within Godot and has the following issues:
Maybe it's time to implement something similar to the GUT panel in this plugin. Open to suggestions.
I'm in the progress of building out go binding for godot here: godot-go. I need support to activate the GUT extension by searching for sub-directories for the gut.gd
file.
I already have a PR up in the godot-vscode-plugin here: godotengine/godot-vscode-plugin#239
thus, these settings works with both patches:
"gut-extension.additionalOptions": "-d --path test/project",
"godot_tools.project_path": "test/project"
thanks!
The extension is activated when:
"activationEvents": [
"workspaceContains:**/addons/gut/gut.gd"
],
If your .gitignore
file has addons/gut
in it, then VSCode will not activate this extension.
One workaround I found was to not ignore gut.gd
in .gitignore
. This isn't the best, but it works and still excludes the majority of the GUT files.
addons/gut/*
!addons/gut/gut.gd
When using a non-bash like terminal as default GutExtension can either not work or have issues. IE Powershell, even zsh is laggy sometimes when zsh-autosuggestions is enabled (But these are not GutExtension Issues).
Since vscode extension launches Gut in the default terminal. This forces the user to select a default integrated terminal that best supports GutExtension and not necessarily the terminal they want to use.
Certainly can be worked around but just annoying sometimes.
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.