Commit Graph

277 Commits

Author SHA1 Message Date
c076a2b7e9 break, continue outside of a loop, match statement handled 2020-05-15 03:16:50 +05:30
00949f0c5f Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
2020-05-14 23:09:03 +02:00
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
5046f666a1 Merge pull request #38610 from ThakeeNathees/infer-type-null-error
set parser error when infer type is null
2020-05-14 21:50:48 +02:00
07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
963a27f8a2 Merge pull request #38611 from ThakeeNathees/shadow-var-warning-bug-fix
shadowed var warning in nested block bug fix
2020-05-14 16:48:56 +02:00
687b1941b4 set parser error when infer type is null 2020-05-13 22:12:23 +05:30
e7c9d81876 Merge pull request #38609 from ThakeeNathees/range-crash-with-non-numeric-const-fix
range() with non-numeric const argument crash fix
2020-05-13 15:42:29 +02:00
dc649684be Merge pull request #38708 from ThakeeNathees/init-assign-type-parser-bug-fix
regression: var declaration type info parser bug fix
2020-05-13 15:41:28 +02:00
e7f056dfac regression: static func can't access const fix 2020-05-13 06:07:22 +05:30
e5d735851d regression: var declaration type info parser bug fix 2020-05-13 05:58:27 +05:30
69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
a128dd97d6 Merge pull request #37020 from aaronfranke/range
Allow using integer vectors for iteration and make range() use them
2020-05-10 13:11:07 +02:00
79eee93b9a shadowed var warning in nested block bug fix
Fix: #38552
2020-05-10 10:54:23 +05:30
3e10392d48 range() with non-numeric const argument crash fix 2020-05-10 10:07:23 +05:30
5758d87f09 more clearer unexpected statement end error messages 2020-05-10 02:35:27 +05:30
cf0953fefa Merge pull request #37598 from ThakeeNathees/GDScript-type-resolve-bug-fix
GDScript class var type resolve bug fixed
2020-05-09 21:59:26 +02:00
c04cdc2bf1 Merge pull request #38412 from ThakeeNathees/static-func-var-access
parser error for static func access non-static variables
2020-05-09 21:32:28 +02:00
cf4482e8c4 Change get_completion_identifier_is_function to return a bool
A minor bugfix
2020-05-09 13:45:00 -04:00
f7b50992b5 Allow using integer vectors for iteration and make range() use them 2020-05-09 13:43:35 -04:00
4d50f747d5 Merge pull request #37293 from Janglee123/ctrl-click-improvements
Improved go-to definition (Ctrl + Click)
2020-05-05 16:49:15 +02:00
be7a353c70 Improved go-to definition (Ctrl + Click)
Co-Authored-By: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
2020-05-05 10:46:12 +05:30
ce978517e0 parser error for static func access non-static variables
Fix: #38408
2020-05-03 11:45:11 +05:30
e6e5ba32cd Mention offending function name in "Indented block expected" error 2020-05-02 17:10:34 -07:00
bd081df519 Fix for marking assert lines as safe bug
Calling _reduce_node_type from GDScriptParser::_parse_block for assert
was using a current class with a scope that didn't include all
functions. Now calling in GDScriptParser::_check_block_types uses the
right class type. We also now check the assert node message. The assert
line was added to the set_errors associated with assert, since before
the error would be reported on the next line
2020-04-27 20:25:54 -05:00
f61587b158 Merge pull request #36927 from ThakeeNathees/export-var-type-reduce-implimented
Fix: export var type reduce() implemented
2020-04-27 17:01:04 +02:00
cd487201c6 export var type reduce() implemented 2020-04-27 19:26:57 +05:30
39f77f95b8 Merge pull request #37265 from BigRed-118/mark_assert_safe
Mark assert lines as safe in gdscript
2020-04-24 17:24:45 +02:00
514fb5fa8a Merge pull request #37232 from ThakeeNathees/load()-autocomplete-imlpemented
autocomplete for load() function implemented
2020-04-24 17:24:23 +02:00
f914276951 Merge pull request #37537 from ThakeeNathees/const-parsing-datatype-bug-fix
GDScript: Fix type inference for const reference to global class
2020-04-21 23:04:46 +02:00
9716204555 Merge pull request #37712 from stoofin/pattern-bind-warning
Fix unassigned variable warnings for match bindings
2020-04-21 23:04:16 +02:00
4f03e302a7 Merge pull request #38041 from ThakeeNathees/class-name-check-enhance
GDScript class name existance check enhanced
2020-04-21 16:19:53 +02:00
a5a9bf6a19 Merge pull request #37955 from ThakeeNathees/lin-unsafe-base-know-index-unkonwn
Line marked unsafe when base known and index unkonwn
2020-04-21 16:19:34 +02:00
2cd952bd84 Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor
Subgroups were added in #37678 but not properly handled everywhere
where PROPERTY_USAGE_GROUP is.
2020-04-20 17:13:06 +02:00
62280c3d47 GDScript class name existance check enhanced 2020-04-20 16:20:36 +05:30
0780ad2800 line unsafe for indexing with known base type & unkown identifier 2020-04-17 16:52:22 +05:30
67f7ba2645 Merge pull request #37395 from ThakeeNathees/collon-equal-parser-bug-fix
`:=` fails on some nodes fix: #37357
2020-04-10 12:36:44 +02:00
44281f233d Pattern bind counts as assignment
Fixes #34697
2020-04-09 05:01:40 -07:00
e67eb5ca36 GDScript class var type resolve bug fixed
Fix: #37545
2020-04-05 08:35:24 +05:30
029b34da40 GDScript: Fix type inference for const reference to global class
Fixes #37529.
2020-04-03 12:43:52 +05:30
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
bdd7048cb5 := fails on some nodes fix: #37357 2020-03-29 16:01:54 +05:30
0b5bad78c0 Fix for loop range bug: #37358 2020-03-28 02:20:58 +05:30
8dc8833782 Mark assert lines as safe in gdscript
Now calling _reduce_node_type with debugging enabled to determine
if assert line is safe. Part of doing this required the assert line
to be stored away. Now the AssertNode line is being correctly set.
Newlines are now marked safe always
2020-03-25 08:42:04 -05:00
d2664a0ff1 autocomplete for load() function implemented 2020-03-22 22:21:34 +05:30
cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
7bf6e5f773 Fix various typos
Found via `codespell`
2020-03-11 13:59:18 -04:00
cdbf033290 Merge pull request #36704 from ThakeeNathees/gdscript-duplicate-args-fix
GDScript duplicate arguments bug fixed
2020-03-10 13:10:00 +01:00