summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_editor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Fix many asan and ubsan reported issuesHein-Pieter van Braam2019-01-301-0/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
* | / GDScript autocomplete: don't carry values when guessing from `is`George Marques2019-01-151-1/+5
| |/ |/| | | | | | | Guessing the type from an `is` operator should no be considered an assigment. This would cause crashes in certain scenarios.
* | Fix code completion on nodes in current sceneTimo Schwarzer2019-01-051-1/+1
| |
* | Fix segfault when trying to autocomplete in inner classesTimo Schwarzer2019-01-031-2/+6
| | | | | | | | Fixes #24697
* | Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Fix GDScript assuming awareness of whole ClassDBPedro J. Estébanez2018-10-281-1/+6
|
* Unify ClassDB lookups for code completionPedro J. Estébanez2018-10-281-28/+24
|
* Optional getters/setters editor autocompleteJakub Grzesik2018-10-231-1/+2
| | | | solves #22291
* Fix warning about functions defined but not used [-Wunused-function]Rémi Verschelde2018-09-291-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 5 warnings: ``` core/io/zip_io.h:128:26: warning: 'zlib_filefunc_def zipio_create_io_from_file(FileAccess**)' defined but not used [-Wunused-function] core/script_debugger_remote.cpp:110:17: warning: 'ObjectID safe_get_instance_id(const Variant&)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:103:12: warning: 'int _socket_create(IP::Type&, int, int)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:45:15: warning: 'size_t _set_sockaddr(sockaddr_storage*, const IP_Address&, int, IP::Type)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:76:15: warning: 'size_t _set_listen_sockaddr(sockaddr_storage*, int, IP::Type, IP_Address)' defined but not used [-Wunused-function] editor/editor_fonts.cpp:40:24: warning: 'Ref<BitmapFont> make_font(int, int, int, int, const int*, const Ref<Texture>&)' defined but not used [-Wunused-function] editor/editor_themes.cpp:85:26: warning: 'Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat>, Color)' defined but not used [-Wunused-function] editor/import/editor_import_collada.cpp:493:13: warning: 'void _generate_normals(const PoolVector<int>&, const PoolVector<Vector3>&, PoolVector<Vector3>&)' defined but not used [-Wunused-function] editor/import/editor_import_collada.cpp:524:13: warning: 'void _generate_tangents_and_binormals(const PoolVector<int>&, const PoolVector<Vector3>&, const PoolVector<Vector3>&, const PoolVector<Vector3>&, PoolVector<float>&)' defined but not used [-Wunused-function] editor/pvrtc_compress.cpp:118:13: warning: 'void _compress_etc(Image*)' defined but not used [-Wunused-function] modules/etc/image_etc.cpp:89:13: warning: 'void _decompress_etc1(Image*)' defined but not used [-Wunused-function] modules/etc/image_etc.cpp:93:13: warning: 'void _decompress_etc2(Image*)' defined but not used [-Wunused-function] modules/gdscript/editor/gdscript_highlighter.cpp:46:13: warning: 'bool _is_whitespace(CharType)' defined but not used [-Wunused-function] scene/2d/cpu_particles_2d.cpp:510:14: warning: 'float rand_from_seed_m1_p1(uint32_t&)' defined but not used [-Wunused-function] scene/3d/cpu_particles.cpp:474:14: warning: 'float rand_from_seed_m1_p1(uint32_t&)' defined but not used [-Wunused-function] scene/resources/default_theme/default_theme.cpp:123:20: warning: 'Ref<Shader> make_shader(const char*, const char*, const char*)' defined but not used [-Wunused-function] scene/resources/default_theme/default_theme.cpp:130:24: warning: 'Ref<BitmapFont> make_font(int, int, int, int, const int*, const Ref<Texture>&)' defined but not used [-Wunused-function] ``` Had to split `core/io/zip_io.h` into header and .cpp file without 'static' keyword. Not fixed yet (static definition in header used in some files but not all): ``` modules/websocket/lws_helper.h:111:13: warning: 'void _lws_make_protocols(void*, int (*)(lws*, lws_callback_reasons, void*, void*, size_t), PoolVector<String>, _LWSRef**)' defined but not used [-Wunused-function] ``` Also fixed a couple other warnings missed in previous commits.
* Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde2018-09-271-0/+2
| | | | | | | | | | | Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
* Fix warnings about unused variables [-Wunused-variable]Rémi Verschelde2018-09-271-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 5 warnings: ``` drivers/gles2/rasterizer_scene_gles2.cpp:1139:15: warning: unused variable 'offset' [-Wunused-variable] drivers/gles2/rasterizer_scene_gles2.cpp:1205:39: warning: unused variable 'multi_mesh' [-Wunused-variable] drivers/gles2/rasterizer_storage_gles2.cpp:359:7: warning: unused variable 'srgb' [-Wunused-variable] drivers/gles2/shader_gles2.cpp:1016:45: warning: unused variable 'texture_hints' [-Wunused-variable] editor/animation_track_editor.cpp:776:9: warning: unused variable 'keys_to' [-Wunused-variable] editor/editor_inspector.cpp:273:7: warning: unused variable 'vs_height' [-Wunused-variable] editor/editor_themes.cpp:202:10: warning: unused variable 'begin_time' [-Wunused-variable] editor/editor_themes.cpp:239:10: warning: unused variable 'end_time' [-Wunused-variable] editor/plugins/animation_blend_tree_editor_plugin.cpp:726:17: warning: unused variable 'an' [-Wunused-variable] editor/plugins/script_text_editor.cpp:1278:8: warning: unused variable 'fold_state' [-Wunused-variable] main/main.cpp:132:13: warning: 'use_vsync' defined but not used [-Wunused-variable] modules/cvtt/image_compress_cvtt.cpp:231:8: warning: unused variable 'y_end' [-Wunused-variable] modules/cvtt/image_compress_cvtt.cpp:311:6: warning: unused variable 'shift' [-Wunused-variable] modules/gdscript/gdscript_editor.cpp:58:7: warning: unused variable 'th' [-Wunused-variable] modules/gridmap/grid_map.cpp:1084:6: warning: unused variable 'ofs' [-Wunused-variable] modules/theora/video_stream_theora.cpp:442:9: warning: unused variable 'tr' [-Wunused-variable] modules/visual_script/visual_script_editor.cpp:2606:6: warning: unused variable 'count' [-Wunused-variable] modules/visual_script/visual_script_editor.cpp:2829:6: warning: unused variable 'seq_count' [-Wunused-variable] modules/visual_script/visual_script_editor.cpp:2844:24: warning: unused variable 'vnode_function' [-Wunused-variable] modules/websocket/lws_peer.cpp:122:12: warning: unused variable 'peer_data' [-Wunused-variable] modules/websocket/lws_peer.cpp:135:12: warning: unused variable 'peer_data' [-Wunused-variable] modules/websocket/lws_peer.cpp:63:12: warning: unused variable 'peer_data' [-Wunused-variable] modules/websocket/lws_peer.cpp:91:12: warning: unused variable 'peer_data' [-Wunused-variable] platform/android/export/export.cpp:763:16: warning: unused variable 'node_size' [-Wunused-variable] scene/gui/rich_text_label.cpp:850:10: warning: unused variable 'x_ofs' [-Wunused-variable] scene/gui/text_edit.cpp:653:8: warning: unused variable 'tab_w' [-Wunused-variable] scene/resources/bit_mask.cpp:186:6: warning: unused variable 'i' [-Wunused-variable] scene/resources/mesh.cpp:549:20: warning: '_array_name' defined but not used [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:107:10: warning: unused variable 'v2' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:108:10: warning: unused variable 'v3' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:109:10: warning: unused variable 'v4' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:110:10: warning: unused variable 'v5' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:111:10: warning: unused variable 'v0n' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:112:10: warning: unused variable 'v1n' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:113:10: warning: unused variable 'v2n' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:114:10: warning: unused variable 'v3n' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:115:10: warning: unused variable 'v4n' [-Wunused-variable] servers/audio/audio_rb_resampler.cpp:116:10: warning: unused variable 'v5n' [-Wunused-variable] servers/visual/default_mouse_cursor.xpm:2:21: warning: 'default_mouse_cursor_xpm' defined but not used [-Wunused-variable] ```
* GDScript: Fix autocompletion inference after `is` checkGeorge Marques2018-09-191-0/+1
| | | | Fix #21915
* GDScript: Fix infinite loop in autocompleteGeorge Marques2018-09-191-4/+8
| | | | | It happened when the definition of the variable contained the variable itself.
* GDScript: Fix autocomplete crash when searching default valuesGeorge Marques2018-09-191-1/+1
| | | | Fix #21700
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-2/+2
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-1/+1
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-1/+1
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
|/ | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* GDScript: Remove space before colon on type hintsGeorge Marques2018-08-261-7/+7
|
* Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-3/+0
|
* Highlight multiline strings as strings instead of commentsHugo Locurcio2018-08-191-1/+1
| | | | | | | | Since multiline comments are not officially supported in GDScript, it is more common to see multiline strings being used as strings rather than as comments (which are actually standalone expressions here). This closes #21142.
* Added system for GDScript warningsGeorge Marques2018-08-101-1/+14
| | | | | | | - Count and panel per script. - Ability to disable warnings per script using special comments. - Ability to disable warnings globally using Project Settings. - Option to treat enabled warnings as errors.
* Allow some non-integer built-in constants in gdscriptBernhard Liebl2018-07-311-2/+2
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Rewrite code completionGeorge Marques2018-07-201-1993/+2150
| | | | | | - Use data type struct from the parser. - Avail from type hints when type can't be guessed. - Consider inner classes and other scripts when looking for candidates.
* Add editor highlight for type-safe linesGeorge Marques2018-07-201-2/+2
| | | | | The line number is hightlighted to indicate that the line contains only type-safe code.
* Use type hints to improve completionGeorge Marques2018-07-201-53/+182
| | | | | | | | - Allow type hints to be completed. - Use type information to infer completion candidates. - Show typed function signature in tooltip. - Add type hints when completing declaration from virtual functions (optional).
* Add static type checks in the parserGeorge Marques2018-07-201-20/+12
| | | | | | | | | | | | - Resolve types for all identifiers. - Error when identifier is not found. - Match return type and error when not returning a value when it should. - Check unreachable code (code after sure return). - Match argument count and types for function calls. - Determine if return type of function call matches the assignment. - Do static type check with match statement when possible. - Use type hints to determine export type. - Check compatibility between type hint and explicit export type.
* Style: Format code with clang-format 6.0.1Rémi Verschelde2018-07-181-1/+1
|
* Merge pull request #19251 from YeldhamDev/script_templates_changesMax Hilbrunner2018-07-031-12/+12
|\ | | | | Small changes to the comments in the script templates
| * Small changes to the comments in the script templates.Michael Alexsander Silva Dias2018-06-111-12/+12
| |
* | Inner classes' functions now appear in the editor's functions panelJairo Honorio2018-06-121-0/+7
|/ | | | Fixes #19386
* Capitalized comments of methods created by the Connect Signal dialog.Michael Alexsander Silva Dias2018-05-231-1/+1
|
* Merge pull request #18405 from flashyincceo/gdscript-constants-helpRémi Verschelde2018-05-171-0/+7
|\ | | | | Fix Ctrl+click on @GDScript constants
| * Fix Ctrl+click on @GDScript constantsPeter Folkins2018-04-241-0/+7
| |
* | Merge pull request #18406 from YeldhamDev/script_templates_periodMax Hilbrunner2018-05-041-1/+1
|\ \ | | | | | | Changed periods in the script templates
| * | Changed periods in the script templates.Michael Alexsander Silva Dias2018-05-021-1/+1
| |/
* | Merge pull request #18452 from flashyincceo/enum-no-classRémi Verschelde2018-05-021-0/+12
|\ \ | | | | | | Fix enums without class name not opening docs page
| * | Fix enums without class name not opening docs pagePeter Folkins2018-05-011-0/+12
| |/
* | Merge pull request #18531 from KidRigger/issue5972Rémi Verschelde2018-05-021-0/+7
|\ \ | | | | | | Adds keywords to autocomplete predictions.
| * | Adds keywords to autocomplete predictions.Anish2018-05-011-0/+7
| |/ | | | | | | | | | | | | Adds keywords to the autocomplete prediction in GDScript so they are not replaced by irrelevant predictions. Fixes: #5972
* / Fix Coverity reports of uninitialized scalar variableRémi Verschelde2018-04-191-2/+3
|/ | | | | | | | | | | Fixes most current reports on Coverity Scan of uninitialized scalar variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html These happen most of the time (in our code) when instanciating structs without a constructor (or with an incomplete one), and later returning the instance. This is sometimes intended though, as some parameters are only used in some situations and should not be double-initialized for performance reasons (e.g. `constant` in ShaderLanguage::Token).
* Merge pull request #16556 from aragar/masterJuan Linietsky2018-04-081-3/+13
|\ | | | | For-in loop variable added to autocompletion
| * For-in loop variable added to autocompletionRado'sPC\aRaGaR2018-02-111-3/+13
| | | | | | | | Fix for #16494
* | Ctrl+Clicking a enum now scrolls down to it in the docs.Felix Yang2018-04-031-1/+26
| |
* | Fix script template on `_ready` behaviorPoommetee Ketson2018-03-151-1/+1
| |
* | Removed whitespaces around arguments of functions.anakimluke2018-02-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | Functions automatically generated by conneting signals via GUI put whitespaces around the arguments of the generated function. This is inconsistent with the style guide. This commit fixes that. (cherry picked from commit 370f84f41cf3ce493c2de687455880d9e1e04be6)
* | Show default values in docs for GDScript built-in functionsGeorge Marques2018-01-301-2/+2
|/
* Merge pull request #15849 from poke1024/preload-completionRémi Verschelde2018-01-181-1/+3
|\ | | | | GDScript: fix autocompletion for preload() (issue 15766)
| * GDScript: fix autocompletion for preload() (issue 15766)Bernhard Liebl2018-01-181-1/+3
| |