Commit Graph

663 Commits

Author SHA1 Message Date
Rémi Verschelde f06b7d40c8 Merge pull request #21449 from vnen/gdscript-builtin-is
Allow `is` operator to test built-in types
2018-08-27 17:48:11 +02:00
Rémi Verschelde 5b87864385 Merge pull request #21369 from Noshyaar/exportflag
Deprecating bit flags export with no hint text
2018-08-27 17:47:21 +02:00
George Marques 4b974a36b7 GDScript: Allow is operator to test built-in types 2018-08-26 13:31:23 -03:00
Poommetee Ketson cee6d5620a Deprecating bit flags export with no hint text 2018-08-24 20:46:04 +07:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
George Marques 94d662ad55 GDScript: Ignore unused arguments/local vars that start with _
Makes it simple to ignore particular arguments without adding special
comments, especially in engine-defined functions.
2018-08-21 20:29:43 -03:00
George Marques abbdb9d951 GDScript: Forbid invalid identifiers in match bindings
Also forbid shadowing a variable from an upper scope.
2018-08-21 13:38:18 -03:00
Will Nations 6d9cc032e7 Add custom icons to script classes. 2018-08-14 14:18:05 -05:00
Chaosus 179e15f876 Remove usage console spam 2018-08-13 16:51:17 +03:00
George Marques eb48119821 Added system for GDScript warnings
- 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.
2018-08-10 16:00:47 -03:00
Bernhard Liebl ba974b8d1e Allow some non-integer built-in constants in gdscript 2018-07-31 17:56:48 +02:00
George Marques e8da2a60b3 GDScript: Fix parse error in string formatting 2018-07-26 10:52:11 -03:00
George Marques 0b78e4f9e3 GDScript: Add type inference syntax for function arguments 2018-07-25 21:06:35 -03:00
George Marques 7db7b43cb0 GDScript: Fix type detection for String formatting operator 2018-07-25 20:50:13 -03:00
George Marques a3ae4a9510 GDScript: Allow accessing constants of outer classes 2018-07-25 20:50:12 -03:00
George Marques 3d6609303b GDScript: Fix bogus error when a cursor token is found on class 2018-07-25 20:50:12 -03:00
George Marques 96ee93e8c7 GDScript: Fix mismatching between export hint and type hint 2018-07-25 20:50:12 -03:00
George Marques 4cb17191b8 GDScript: Allow inherited method to add optional arguments
Also show the parent method signature in the error message.
2018-07-25 20:50:11 -03:00
George Marques b7bd85e70c GDScript: Look up local scope first for detecting type 2018-07-25 20:50:11 -03:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
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.
2018-07-26 00:54:16 +02:00
George Marques 3e87ad5187 Rewrite code completion
- 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.
2018-07-20 21:55:18 -03:00
George Marques 3445dca01d Add ability to infer variable type from assigned value
Syntax: var x : = 42
Infers the type of "x" to be an integer.
2018-07-20 21:55:18 -03:00
George Marques 03746da73f Add editor highlight for type-safe lines
The line number is hightlighted to indicate that the line contains only
type-safe code.
2018-07-20 21:55:18 -03:00
George Marques a2305cd8b2 Fix line number detection in some parser nodes 2018-07-20 21:55:17 -03:00
George Marques e3d72d14ff Use type information to enable GDScript introspection
This makes the Script API provide accurate information when requesting
property or method info.
2018-07-20 21:55:17 -03:00