Commit graph

907 commits

Author SHA1 Message Date
Rémi Verschelde
4f294b958f doc: Sync classref with current source
Fix a few missing bindings or unspecified argument names and default values.
2019-09-24 11:52:06 +02:00
Hugo Locurcio
c1fcb22677
Fix line being assigned to twice in the GDScript language server
This closes #32090.
2019-09-23 15:27:30 +02:00
qarmin
50be65bf43 Changed some code found by Clang Tidy and Coverity 2019-09-22 18:45:08 +02:00
Rémi Verschelde
25a1bfed5c
Merge pull request #32210 from Calinou/editor-log-distinguish-messages
Distinguish editor-originating messages in the editor log
2019-09-20 20:22:43 +02:00
Rémi Verschelde
fdc2463a1b
Merge pull request #32150 from luzpaz/typos
Fix misc. source comment typos
2019-09-20 17:09:05 +02:00
Hugo Locurcio
ba566dff2e
Distinguish editor-originating messages in the editor log
This fades out messages originating from the editor to make messages
printed by the project stand out more.

This also tweaks wording in some editor messages for consistency.
2019-09-20 01:59:02 +02:00
luz.paz
91ecd7b6a6 Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-19 14:36:52 -04:00
Rémi Verschelde
c3d5c96494
Merge pull request #31921 from bojidar-bg/28978-uninitialized-array-value
Fix uninitialized arrays and dictionaries retaining value
2019-09-19 20:31:12 +02:00
Rémi Verschelde
291f408fcf
Merge pull request #32100 from SaracenOne/gdscript_parent_const_types
Fix const deceleration for inherited scripts above immediate parent
2019-09-19 20:11:37 +02:00
Rémi Verschelde
b5f14cc6f7
Merge pull request #31934 from mitchcurtis/28187
Produce an error when a class has the same name as a Singleton
2019-09-19 20:05:41 +02:00
Rémi Verschelde
318ac6ee13
Merge pull request #31142 from mitchcurtis/assert-message
GDScript: add an optional message parameter to assert()
2019-09-19 19:56:05 +02:00
Mitch Curtis
aa8e3e7b0f GDScript: add an optional message parameter to assert()
Before this patch, assert() only took the condition to assert on:

    assert(item_data)

Now, it can optionally take a string that will be printed upon failure:

    assert(item_data, item_name + " has no item data in ItemDatabase")

This makes it easier to immediately see what the issue is by being
able to write informative failure messages.

Thanks to @wiped1 for sharing their patch, upon which this is based.

Closes #17082
2019-09-11 15:37:11 +02:00
Saracen
cf00f35a8e Allow for constant deceleration to be detected inherited scripts above the immediate parent. 2019-09-11 06:19:20 +01:00
Mitch Curtis
8f5ffeeacc Produce an error when a class has the same name as a Singleton
If you somehow end up with a Singleton.gd that looks like this:

	extends Node

	class_name Singleton

	func foo():
	    pass

You will get an error when using it in another file:

	extends Node2D

	func _init():
	    # Parser Error: Non-static function "foo" can only be called from an instance.
	    Singleton.foo()

This error is confusing. This patch ensures that an error on the class_name line will be produced:

    Parse Error: The class "Singleton" conflicts with the AutoLoad singleton of the same name, and is therefore redundant. Remove the class_name declaration to fix this error.

Fixes #28187.
2019-09-06 17:12:43 +02:00
iwek7
617797c47c Adds skip-breakpoints feature 2019-09-03 20:49:09 +02:00
MrCdK
9e9c16c1e5 Try and show all the properties added with _get_property_list() when triggering completion.
Closes https://github.com/godotengine/godot/issues/25097
2019-09-03 14:27:27 +02:00
Bojidar Marinov
3ca7b4ee45
Fix uninitialized arrays and dictionaries retaining value
Fixes #28978
2019-09-03 10:39:04 +03:00
Rémi Verschelde
10b040ab20
Merge pull request #31893 from bojidar-bg/25081-gdscript-index-self
Re-allow indexing on objects and other non-builtin types
2019-09-02 20:25:14 +02:00
Rémi Verschelde
85955c5f25
Merge pull request #31843 from 2shady4u/parserCtrlClick
Solves ctrl+click on functions by ignoring the cursor
2019-09-02 19:56:35 +02:00
Bojidar Marinov
e3d05fa42d
Re-allow indexing on "self" and object types in GDScript
Fixes #25081
2019-09-02 20:18:15 +03:00
Rémi Verschelde
eb38bc6c0a gdscript: Fix build after #24925
The PR did not use the ScriptCodeCompletionOption system introduced
later on, and somehow this did not generate a merge conflict even
though neighboring code was changed.
2019-09-02 16:31:43 +02:00
Rémi Verschelde
877912b23c
Merge pull request #24925 from Mr-Slurpy/typed-autoload
Added autoloads as a potential type.
2019-09-02 16:05:05 +02:00
Rémi Verschelde
d767edb9b3
Merge pull request #21443 from deepmax/ord_function
Add ord() function to return Unicode code point of a string of length one
2019-09-02 15:28:15 +02:00
shaderbeast
dbd253d7a2 Solves ctrl+click on functions by ignoring the cursor
Obeyed CLANG format rules


Obeying CLANG format rules attempt 2


Obeying CLANG format rules attempt 3


Clean up


Fixed runaway while loop


Removed int initialization
2019-09-02 13:46:38 +02:00
Rémi Verschelde
65d61d0360 doc: Sync classref with current source 2019-08-29 15:33:52 +02:00
Thomas Karcher
02ed79f7f7
Updated description for "stepify"
Mentioned the possibility to use stepify as a rounding function; +code examples
2019-08-29 14:03:18 +02:00
Rémi Verschelde
b97169740e
Merge pull request #31741 from akien-mga/lsp-requires-websocket-jsonrpc
GDScript: Disable LSP if either jsonrpc or websocket are disabled
2019-08-29 08:37:40 +02:00
Rémi Verschelde
7995ce03f3
Merge pull request #31738 from bojidar-bg/31056-class_name-extends
Remove check for class_name and extends order
2019-08-29 08:33:51 +02:00
Masoud Montazeri
5565f5591f Add ord() function to return Unicode code point of a string of length one 2019-08-28 16:14:11 +02:00
Rémi Verschelde
b791efdb16
Merge pull request #31737 from bojidar-bg/31455-stack-underflow
Fix yield check in GDScriptFunction
2019-08-28 15:36:08 +02:00
Rémi Verschelde
b994124df3 GDScript: Disable LSP if either jsonrpc or websocket are disabled
Follow-up to #29780.
2019-08-28 13:29:37 +02:00
Rémi Verschelde
46ad60385b
Merge pull request #29780 from GodotExplorer/gdscript-lsp
Add Language Server Protocol for GDScript
2019-08-28 13:06:51 +02:00
Bojidar Marinov
b70b16a20f
Remove check for class_name and extends order
Closes #31056
2019-08-28 12:05:21 +03:00
Bojidar Marinov
112aa6e367
Fix yield check in GDScriptFunction
Fixes #31455
2019-08-28 11:15:43 +03:00
Rémi Verschelde
185072015f
Merge pull request #31606 from toasteater/fix/nativescript-new-json-return-type
Fix the return type of NativeScript::new in API json
2019-08-28 09:15:40 +02:00
Michael Alexsander Silva Dias
a8826ad3b8 Make 'break' and 'continue' be marked as safe 2019-08-27 23:10:33 -03:00
toasteater
e2121c97ae Make VarArg methods return types show up as Variant in API json
VarArg methods have the return type Object in the API json for GDNative. This
can cause undefined behavior in some language bindings due to lack of
documentation on VarArg methods' behavior.

This changes the MethodInfo of:

- CSharpScript::_new
- GDScript::_new
- PluginScript::_new
2019-08-26 16:36:51 +00:00
Hugo Locurcio
a4794af5df
Improve writing style in GDScript error/warning messages
This uses double quotes everywhere for consistency.
2019-08-23 20:55:50 +02:00
Rémi Verschelde
d3153c28f0 Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'
The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is
(conditionally defines the error message).

There are a few ERR_EXPLAINC calls for C-strings where String is not included
which can stay as is to avoid adding additional _MSGC macros just for that.

Part of #31244.
2019-08-17 13:31:22 +02:00
Rémi Verschelde
37a16fee05 Export: Remove temp files from cache after export
So far we left most temporary files lying around, so this attempts to
fix that.

I added a helper method to DirAccess to factor out the boilerplate of
creating a DirAccess, checking if the file exists, remove it or print
an error on failure.
2019-08-12 13:31:59 +02:00
geequlim
e5b91a15e6 Improve code compeletion for virtual methods with signatures 2019-08-11 14:06:39 +08:00
geequlim
72d11cd173 Add optional goto definition support for native symbols
This action will show help for target symbol in godot editor and bring the godot editor window to foreground
Improved markdown documentation for symbols.
2019-08-11 13:30:15 +08:00
Geequlim
666ed89011 Add generate script api to dictionary support
Expose GDScriptLanguageProtocol singleton and classes for editor plugins (Not visiable in class tree)
Fix minor bug in symbol resolve
2019-08-11 13:30:15 +08:00
Geequlim
9618b0c63e Check client workspace directory is valid
Drop test initialize message sent to client
Remove unused code property for the parser class
2019-08-11 13:30:15 +08:00
Geequlim
b2f02317fa Improve symbol resolve for inner classes
Only level one inner classes would be resolved currently but it sould cover most real world use case
Improve documation parseing for const values
Improve documation format for native symbols
2019-08-11 13:30:15 +08:00
Geequlim
76c9e4ceb7 Improved performance for completion and symbol resolvation.
Improved uri and workspace path translatation on windows platform.
The smart resolvation is much faster than builtin's in the server side.
The smart resolve mode is still disabled as default as the clients might be slow with a planty of completion items.
2019-08-11 13:30:15 +08:00
geequlim
fa6d6a329c Add optional smart resolve sulotion
The smart resolvaion can guess most symbols but it might be slow so disabled by default users can turn on it in the editor setting
2019-08-11 13:30:15 +08:00
geequlim
37aafaaa9c Add a symbol pool to cache all native symbols and workspackes symbols.
Implement hover
Implement completion documentation resolve
Implement hover documentation
Implement go to definition
2019-08-11 13:30:15 +08:00
geequlim
f58560ac36 Add GDScript Language Protocol plugin 2019-08-11 13:30:15 +08:00
Rémi Verschelde
80c7cb6378
Merge pull request #31227 from profan/fix/err-explain-usages
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", "modules/gdnative", "modules/gdscript" directories.
2019-08-09 12:28:06 +02:00