Commit Graph

220 Commits (dec5a373d97cbadce5e1fabe6095ae9957ff3aa6)

Author SHA1 Message Date
passivestar 0ff5d5fd04 Add theme type variations for secondary Trees and ItemLists 2024-11-19 18:33:30 +07:00
passivestar 6ba86c3852 Disable the debugger thread selector when there's nothing to select 2024-11-19 17:11:43 +07:00
MewPurPur 5769c80196 Add minimum size to some debugger elements 2024-11-12 12:35:41 +07:00
Hugo Locurcio 3e8a24d0da
Display CPU and GPU model name in the editor visual profiler
This shows the information from the remote device, which will typically
differ from the local device in remote debugging scenarios.
2024-11-11 19:51:54 +07:00
Thaddeus Crews f3294e59e1
Merge pull request #98891 from Faless/debugger/game_view_settings
[Debugger] Better settings configuration for RuntimeNodeSelect and Window quit
2024-11-10 12:12:46 +07:00
Fabio Alessandrelli 7cd850b909 [Debugger] Move quit shortcut configuration to the SceneDebugger 2024-11-07 15:03:17 +07:00
Michael Alexsander 81cb7658f8
Reload cached resources in runtime on file reimport 2024-11-05 10:51:20 +07:00
Michael Alexsander 16524a8a01
Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 +07:00
Aaron Franke 562c666e3d
Rename internal Button icon to button_icon to match exposed methods 2024-10-29 16:23:03 +07:00
yds e6eeaf28df Add editor setting to stop the bottom panel from switching to the stack trace 2024-10-29 19:50:13 +07:00
Danil Alexeev be41e6f84e
Clarify `EngineDebugger` and `EditorDebugger*` documentation 2024-10-21 11:36:59 +07:00
Ricardo Subtil 0d098d3cca Support REPL expressions through DAP `evaluate` request 2024-10-03 21:28:38 +07:00
kobewi 645abdbb80 Add expression evaluater to debugger (REPL)
Co-authored-by: rohanrhu <rohanrhu2@gmail.com>
2024-10-01 15:36:09 +07:00
Hendrik Brucker c53fd9c7be Implement Autostart Feature for Profiler / Visual Profiler / Network Profiler
Co-authored-by: stmSi <stm1998sithumyo@gmail.com>
2024-09-10 19:40:42 +07:00
bruvzg b5e3238109
[TextServer] Fix get_word_breaks and it uses. 2024-06-21 14:56:57 +07:00
A Thousand Ships d9e2fc74c7
[Scene] Add `SceneStringNames::item_selected` 2024-06-19 09:39:05 +07:00
A Thousand Ships d519715d94
[Scene] Add `SceneStringNames::font(_size/_color)` 2024-06-18 17:24:27 +07:00
A Thousand Ships 926afccbd8
[Scene] Add `SceneStringNames::panel` 2024-05-30 22:54:50 +07:00
A Thousand Ships 755a0efbb6
[Scene] Add `SceneStringNames::id_pressed` 2024-05-30 22:54:04 +07:00
Rémi Verschelde c42751cae2
Merge pull request #91033 from Hilderin/keep_current_bottom_panel_on_play
Add editor setting to keep bottom panel state on play and stop game
2024-05-29 22:13:45 +07:00
Hilderin 76205d4276 Add editor setting to keep bottom panel state on play and stop game 2024-05-29 05:45:17 +07:00
A Thousand Ships ee79386f7b
[Scene] Add SceneStringNames::pressed 2024-05-14 15:51:28 +07:00
A Thousand Ships 955d5affa8
Reduce and prevent unnecessary random-access to `List`
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +07:00
Ricardo Subtil b6d1204186 Add output type to DAP `output` events 2024-03-14 14:34:14 +07:00
Muller-Castro 1638c1b28f Add const lvalue ref to editor/* container parameters 2024-02-26 15:28:15 +07:00
A Thousand Ships 684752e75b
Replace error checks against `size` with `is_empty` 2024-02-09 12:50:15 +07:00
Yuri Sizov c027aecc2e Merge pull request #86676 from rune-scape/sparse-script-reload
GDScript: Hot-reload changed scripts only
2024-01-17 18:52:54 +07:00
Yuri Sizov 95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +07:00
Rémi Verschelde 6c390b620d
Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +07:00
rune-scape cde478bda6 Hot-reload only changed scripts 2024-01-02 17:56:52 +07:00
msreis f1cc14d525 Fix missing time for some script functions in profiler
Fixes the issue by adding a mechanism by which the functions that were
previously disappearing can be profiled too. This is optional with
an editor setting, since collecting more information naturally slows the engine
further while profiling.

Fixes #23715, #40251, #29049
2023-12-19 19:42:21 +07:00
Wilson E. Alvarez a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 +07:00
Saracen 3700ce7318 Fix right-click menu position for the debugger breakpoint tree. 2023-10-06 19:47:19 +07:00
Yuri Sizov 4bd569be95 Replace flat buttons with flat-styled buttons with a visible pressed state 2023-09-19 22:36:29 +07:00
kobewi 6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +07:00
Yuri Sizov 2445414aa0 Avoid unnecessary inspector updates when loading or switching scenes
This should result in some noticeable performance improvements,
aside from fixing bugs due to conflicts in logic.
This also simplifies some related code identified while debugging.
2023-08-12 13:32:59 +07:00
Rémi Verschelde 8b6c867c81
Merge pull request #79280 from raulsntos/dotnet/better-push-error
C#: Improve `GD.PushError` and `GD.PushWarning`
2023-08-03 14:46:44 +07:00
Juan Linietsky 5e512b705e Support threads in the script debugger
* This implementation adds threads on the side of the client (script debugger).
* Some functions of the debugger are optimized.
* The profile is also now thread safe using atomics.
* The editor can switch between multiple threads when debugging.

This PR adds threaded support for the script language debugger. Every thread has its own thread local data and it will connect to the debugger using multiple thread IDs.
This means that, now, the editor can receive multiple threads entering debug mode at the same time.
2023-07-26 12:06:45 +07:00
Raul Santos 13ab2b6f4f
C#: Improve `GD.PushError` and `GD.PushWarning`
- Use the name, file path and line number of the caller that invokes
`GD.PushError` and `GD.PushWarning` instead of the location in the C++
`runtime_interop.cpp` file.
- Improvements to getting the C# stack trace.
  - Use C# type keywords for built-in types in method declarations.
  - Remove extra space before each parameter in method declarations.
  - Skip one more frame to avoid `NativeInterop.NativeFuncs`.
  - Skip methods annotated with the `[StackTraceHidden]` attribute.
- Improvements to `ScriptEditorDebugger` when source is in project.
  - Avoid overriding error metadata when the source is inside the
project file.
  - Use the source function in the title when the source is inside
the project file.

Users that use these methods would expect the reported location printed
by these methods to correspond to a location in their project source files.
Specifically, they'd expect to see the file path and line number at which
they call these methods, and not the location of the C++ code (which is
always the same). Now, these methods are a lot more useful since users
can know which line in their source code printed the error/warning.
2023-07-11 11:19:11 +07:00
samar-01 d9e64d7001 Changed error tree initialization to allow reselection 2023-06-10 22:47:16 +07:00
Aaron Franke 74361b3d50
Rename the Debugger's stack debug section to Stack Trace 2023-05-11 21:22:24 +07:00
Hendrik Brucker dc46163b12 Improve editor state persistence 2023-05-11 04:17:03 +07:00
Yuri Sizov 4154039832 Improve includes of EditorNode (and everything else)
Also start organizing editor-specific GUI components
into a dedicated folder, `editor/gui`.
Also move `editor_file_server` next to the rest of debugger classes.
2023-04-07 18:59:49 +07:00
kobewi f289e74966 Refresh filesystem when saving remote branch 2023-03-24 19:38:08 +07:00
Yuri Sizov 239eb31c90 Make sure Script Debugger is updated with the editor theme 2023-03-10 18:16:00 +07:00
Pedro J. Estébanez 31a4a0002e Pace debugger draw requests 2023-02-07 12:10:28 +07:00
Paul Joannon 0fb1cef42f
Restore missing info in the error tooltips 2023-01-28 12:34:12 +07:00
Paul Joannon c93eec4139
Better error display in debugger panel
- Use the right stack frame info as title of the error.
- Use the actual C# exception type as error for exceptions raised from C#.
- Show the right language instead of always **C++ Error**.
2023-01-27 10:01:55 +07:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +07:00
stmSi 97e991929f Fix: Profiler and Visual Profiler start/stop state inconsistency 2022-12-23 08:14:53 +07:00
Haoyu Qiu 207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +07:00
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +07:00
Zae 50704f27ed FIx debugger can't inspect sub objects. 2022-11-25 11:09:18 +07:00
Rémi Verschelde 6d2a7cb46d
Merge pull request #68709 from MewPurPur/instance-begone-part3
Remove more instances of 'instance' being used as a verb
2022-11-16 14:41:42 +07:00
VolTer 3b4f5f8a04 Remove more instances of 'instance' being used as a verb 2022-11-16 14:01:53 +07:00
Fabio Alessandrelli 67265d14f7 [MP] Move engine and editor profilers to a plugin.
Also refactor the editor plugin out of the ReplicationEditor.
2022-11-14 15:09:00 +07:00
Fabio Alessandrelli d568b25e36 [Editor] Better expose EditorDebuggerPlugin.
Now splitted into two classes:
- EditorDebuggerPlugin (RefCounted).
- EditorDebuggerSession (abstract).

This allows the EditorPlugin to be in control of the debugger plugin
lifecycle, be notified when sessions are created, and customize each of
them independently.

We should slowly transition the various profilers and captures in
ScriptEditorDebugger to their own plugins, and decouple
ScriptEditorDebugger from it's UI part (making it the "real"
EditorDebuggerSession potentially dropping the wrappers).
2022-11-14 14:55:22 +07:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +07:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +07:00
Rémi Verschelde 4d29346a74 Debugger: Fix fetching source to link C++ error on GitHub
Fixes #66974.
2022-10-06 11:45:27 +07:00
halgriffiths 026e0811b9 Fix profiler being disabled at wrong times
Co-authored by: Will Whitty <tavurth@gmail.com>
2022-09-13 10:21:11 +07:00
Micky 97f8c9b97c Rename TreeItem's `set_tooltip` to `set_tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`get_tooltip` -> `get_tooltip_text`

For consistency:
`get_button_tooltip` -> `get_button_tooltip_text`
And the `tooltip` parameter in `add_button` was renamed to `tooltip_text`
2022-08-30 11:16:23 +07:00
Rémi Verschelde fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +07:00
Rémi Verschelde f7f8af232c
Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +07:00
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 +07:00
Micky ef5b9a06a9 Rename `hint_tooltip` to `tooltip_text` & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +07:00
kobewi ccb1720cb3 Make Debugger/Misc LineEdits uneditable 2022-08-18 21:34:12 +07:00
Yuri Sizov 9f55bd971e Extract EditorResourceConversionPlugin into its own source files and clean up editor includes 2022-07-31 21:14:15 +07:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +07:00
Hristo Stamenov e0742be4db Double check the selected tree item on error activated and error selected callbacks as the value might be nullptr which would cause a crash. 2022-07-06 16:24:26 +07:00
Voylin cebdfd1bbd Fixing Print_rich which only displays correctly in terminal
There was an issue that the type was not passed through correctly. These couple of lines fix this issue and make print_rich work as expected.
2022-07-01 04:34:19 +07:00
bruvzg b5c96df277
Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +07:00
Fabio Alessandrelli ac878ed9b8
Merge pull request #61736 from KoBeWi/final_form_of_the_fix
Fix Debugger tab not updating when clearing errors
2022-06-12 20:46:45 +07:00
Rémi Verschelde c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +07:00
kobewi 79c7d5b2ab Fix Debugger tab not updating when clearing errors 2022-06-06 01:27:09 +07:00
FireForge 7f7244f04a Use consistent casing in editor filter/search bars 2022-05-28 18:43:16 +07:00
trollodel 307427af89 Add the button pressed to some signals in Tree 2022-05-21 17:16:52 +07:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +07:00
Hugo Locurcio 79be2c7b75
Rename profiler "Idle Time" to "Process Time"
References to "idle time" are progressively being replaced by
"process time" throughout the engine to avoid confusion.
2022-05-05 20:23:47 +07:00
Aaron Franke b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 +07:00
Hugo Locurcio 5626d026d8
Add an external link editor icon
This replaces the existing "chainlink" instance icon that was
used for external links. That icon is still used for scene instancing.

The icon was designed by redlamp.

Co-authored-by: Taylor Wright <taylor@redlamp.org>
2022-04-24 17:26:29 +07:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +07:00
FireForge efd9b8bc29 Capitalize names in the debugger 2022-03-29 09:07:08 +07:00
Haoyu Qiu ccde2bf66f Add property name style toggle to Inspector 2022-03-28 18:52:09 +07:00
Rémi Verschelde 5c8bd6fd71
Merge pull request #58233 from bruvzg/gde_ts 2022-03-18 14:29:58 +07:00
Michael Alexsander deb1342036 Make `TabBar/Container` default their alignments to the left instead of center 2022-03-17 18:12:23 +07:00
bruvzg f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +07:00
Haoyu Qiu 0ac6e6acbe More icon updates on theme change 2022-03-15 23:05:41 +07:00
reduz 21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +07:00
Michael Alexsander a811ebf699 Make `TabContainer` use `TabBar` internally 2022-03-03 21:49:58 +07:00
jmb462 dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +07:00
trollodel 05b56f316d Remove most EditorNode constructor parameters and fields 2022-02-14 14:16:24 +07:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +07:00
Rémi Verschelde d22ac13bc2
Merge pull request #57715 from Faless/debugger/4.x_core_includes_and_servers
[Debugger] Move most profilers to ServersDebugger, fix core includes.
2022-02-09 21:57:32 +07:00
Rémi Verschelde 90162851a7
Core: Move generated `VERSION_HASH` to a `.cpp` file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +07:00
Rémi Verschelde fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +07:00
jmb462 a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +07:00
Fabio Alessandrelli 6583797305 [Debugger] Move servers-related behaviours to ServersDebugger.
Forcing draw during debug break is now handled by ServersDebugger, and
only happens when the proper message is sent from the EditorDebugger
("servers:draw").
In a similar way, briging the window in foreground is now also handled
by ServersDebugger upon receiving "servers:foreground" which is sent by
the EditorDebugger when resuming from a break ("continue").
2022-02-06 17:36:48 +07:00
Fabio Alessandrelli 87f4bbd668 [Debugger] Move most profilers to ServersDebugger.
Also splits bandwidth/rpc profiler (RPCProfiler is now in
SceneDebugger).
2022-02-06 17:36:48 +07:00
jmb462 1ce81dc5f2 Add missing SNAME macro optimization in some function calls 2022-02-06 15:54:04 +07:00