Commit graph

228 commits

Author SHA1 Message Date
cdemirer e9a5beeb01 Fix crash while trying to autocomplete non-global Autoload 2022-07-18 16:35:25 +03:00
Rémi Verschelde fdff28e1a2
Merge pull request #62699 from cdemirer/fix-autocomplete-var-assigned-same-statement 2022-07-06 15:57:19 +02:00
Rémi Verschelde 4c56885bc0
Merge pull request #62690 from cdemirer/fix-infinite-guess-recursion 2022-07-06 15:54:16 +02:00
Rémi Verschelde 4873886830
Merge pull request #62760 from cdemirer/fix-annotation-initializer-conflict
Fix priority of annotated type vs initializer type
2022-07-06 15:47:56 +02:00
Rémi Verschelde 635d447a69
Merge pull request #62713 from YuriSizov/docs-scripting-annotations 2022-07-06 15:31:19 +02:00
Rémi Verschelde ea61cd3b32
Merge pull request #62707 from YuriSizov/gdscript-group-those-props 2022-07-06 15:24:07 +02:00
cdemirer f280975bf1 Fix priority of annotated type vs initializer type 2022-07-06 04:25:44 +03:00
reduz 5ac42cf576 Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-05 22:13:37 +02:00
Yuri Sizov f85bafaa11 Add grouping annotations for class properties in GDScript 2022-07-05 22:01:40 +03:00
Yuri Sizov a9098e6147 Add support for documenting built-in annotations 2022-07-04 20:21:39 +03:00
cdemirer 3a827349bf Fix autocomplete for variable which is assigned to in the current statement 2022-07-04 10:08:41 +03:00
cdemirer bd518f6b11 Fix infinite recursion when guessing type of variable which is being assigned to 2022-07-04 02:49:36 +03:00
Marcus Elg 6c1ac9f3be Rename export_range's noslider option to no_slider 2022-06-24 10:45:34 +02:00
Marcus Elg 46bbbd9770 Allow autocompletion of "noslider" in export_range 2022-06-19 17:11:49 +02:00
Rémi Verschelde e465b72b9b
Merge pull request #61389 from snailrhymer/lookup-fix 2022-05-25 18:38:29 +02:00
SnailRhymer 3a87d1acae Make Lookup Symbol recognize assert and preload in the script editor 2022-05-25 16:41:10 +01:00
SnailRhymer 688a62d841 Fix lookup_code to properly handle symbols at start of assignments 2022-05-25 11:45:57 +01:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02: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 +02:00
Yuri Rubinsky a439832035 Fix signal completion in GDScript editor 2022-05-12 16:10:48 +03:00
reduz 8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Hugo Locurcio 180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Markus Sauermann a793960a10 Fix cppcheck const parameters
Convert method signature parameters to const where it is possible

# Conflicts:
#	drivers/gles3/rasterizer_canvas_gles3.cpp
#	drivers/gles3/rasterizer_canvas_gles3.h
#	editor/plugins/animation_state_machine_editor.cpp
#	editor/plugins/animation_state_machine_editor.h
2022-04-28 11:35:39 +02:00
David Maziarka 1f62965d26 Add built-in Variant types to autocompletion list
Co-authored-by: Gustav <gusan092@student.liu.se>
2022-04-07 11:10:19 -05:00
George Marques 4710e2b278
GDScript: Add support for static method calls in native types 2022-04-06 14:14:38 -03:00
Rémi Verschelde c630c2001d
Merge pull request #59633 from EricEzaM/better-code-complete-update
Improve sorting of Code Completion options.
2022-04-03 12:34:00 +02:00
Eric M 4ab605d14d Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
2022-04-01 20:39:09 +10:00
Yuri Roubinsky 0584387918 Fix autocompletion of static methods in built-in types in GDScript 2022-03-30 17:40:41 +03:00
Rémi Verschelde c9b75431f3 Refactor GDScript/C# script templates logic to be editor-only
Not a full refactor as it still goes through ScriptLanguage so it's hacky,
but at least it can now compile without this.
2022-03-28 16:21:00 +02:00
Rémi Verschelde 143d13717b
Merge pull request #59553 from reduz/script-extension-support 2022-03-28 13:35:21 +02:00
Juan Linietsky ed14ff5a08
Revert "Sort autocomplete/code completion options in a better way" 2022-03-28 13:31:32 +02:00
Rémi Verschelde 795304e34f
Merge pull request #59612 from YeldhamDev/style_and_grace 2022-03-28 11:36:27 +02:00
Michael Alexsander 42df9ed059 Make script templates follow the GDScript style guide 2022-03-28 01:32:12 -03:00
reduz 360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
Eric M f9e1c094a2 Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
2022-03-24 22:24:14 +10:00
kobewi 2057ea2883 Remove duplicate editor settings definitions 2022-03-06 22:05:49 +01:00
SaracenOne b6aa4ed55d Fixes cyclic detection from variables assigning themselves to themselves in autocomplete, and restricts initialization of variables from other variables which have not been declared above it in class body 2022-02-22 01:21:21 +00:00
Rémi Verschelde 317cd0b19a
Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
Rémi Verschelde 89eb6d372d
Merge pull request #57591 from vnen/gdscript-enum-fixes 2022-02-04 13:49:15 +01:00
Anilforextra adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
George Marques ad6e2e82a9
GDScript: Consolidate behavior for assigning enum types
This makes sure that assigning values to enum-typed variables are
consistent. Same enum is always valid, different enum is always
invalid (without casting) and assigning `int` creates a warning
if there is no casting.

There are new test cases to ensure this behavior doesn't break in
the future.
2022-02-03 13:32:16 -03:00
Rémi Verschelde f0382530a7
Merge pull request #56268 from KoBeWi/🚗complete_setters 2022-01-13 12:40:48 +01:00
Rémi Verschelde b3513cffc5
Merge pull request #56326 from NNesh/fix/unknown_default_value_callable
Extended the _make_arguments_hint function to get default values for function arguments in hint
2022-01-10 21:29:13 +01:00
NNesh 374baff747 Fixed <unknown> text for callable default value for a function arguments hint
Format switch

Added a case for constant subscripts

Fixed default value hinting for the enum type

Removed is_null checking for value

Added a case for dictionary
2022-01-10 23:22:35 +05:00
Rémi Verschelde 393a44b275
Merge pull request #55213 from Scony/fix-gdscript-crash 2022-01-06 20:54:03 +01:00
Rémi Verschelde 6d4ed65f4c
Merge pull request #56483 from vnen/gdscript-warning-annotation
Add annotation to ignore warnings
2022-01-05 09:05:56 +01:00
George Marques fd643c903d
GDScript: Add annotation to ignore warnings 2022-01-04 09:32:43 -03:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
fabriceci 9d5b807059 Improve editor template workflow
Co-Authored-By: jmb462 <jmb462@gmail.com>
2022-01-02 21:52:09 +01:00
kobewi c055c912fb Remove autocomplete_setters_and_getters setting 2021-12-27 00:48:32 +01:00