Commit Graph

44 Commits

Author SHA1 Message Date
ajreckof 006e899bb3 sort code completions with rules
Fixups

Add levenshtein distance for comparisons, remove kind sort order, try to improve as many different use cases as possible

Trying again to improve code completion

Sort code autocompletion options by similarity based on input

To make it really brief, uses a combination `String.similiary`, the category system introduced in a previous PR, and some filtering to yield more predictable results, instead of scattering every completion option at seemingly random.

It also gives much higher priority to strings that contain the base in full, closer to the beginning or are perfect matches.

Also moves CodeCompletionOptionCompare to code_edit.cpp

Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
Co-Authored-By: Eric M <41730826+EricEzaM@users.noreply.github.com>
2023-05-23 05:12:34 +02:00
Paulb23 0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
Yuri Sizov db2f99cdc0 Implement theme item cache in TextEdit and CodeEdit 2023-04-03 18:01:10 +02:00
Yuri Sizov c311490600
Merge pull request #74665 from YuriSizov/code-edit-is-a-complete-drag
Prevent passing events from CodeEdit to TextEdit when code completion is active
2023-03-20 16:47:45 +01:00
Nong Van Tinh bb3d0fc6b7 Fixes  gutter set width results in receiving only half of the desired size 2023-03-20 00:14:16 +07:00
Yuri Sizov ff98395556 Prevent passing events from CodeEdit to TextEdit when code completion is active 2023-03-09 15:54:08 +01:00
kobewi b427d3585c Allow unindent without selection 2023-01-18 17:05:15 +01:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Rémi Verschelde 82b1cd6753
Merge pull request #62675 from Jummit/tolerant_lookup
Allow drag-clicking before symbol lookup
2022-12-03 21:30:57 +01:00
Michael Alexsander 4b6e6c6758 Stop centering clicked suggestions in the autocomplete popup 2022-10-28 20:22:28 -03:00
Jummit a6c1cfae99 Allow drag-clicking before symbol lookup
This makes it easier for touch and tablet users to do symbol lookups in
the code editor.
2022-10-09 18:42:54 +02:00
Paulb23 4a9d4e3dad Add mutliple Caret support to TextEdit 2022-10-05 17:19:26 +01:00
kobewi 8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
MinusKube 336400dc42 Add the ability to drag the code completion scrollbar using the mouse click 2022-07-03 23:47:52 +02: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
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
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
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
Paulb23 0caab00d66 Fix breakpointed_lines out of sync when removing lines above 2021-10-06 14:23:37 +01:00
Paulb23 35264d5782 Change completion prefixes to single char and unnecessary ui_cancel accept_event 2021-09-20 09:42:39 +01:00
Paulb23 ce064348fa Add CodeEdit breakpoint unit tests 2021-09-01 16:46:04 +01:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Paulb23 a736fb8ce9 Fix breakpoint toggle signal not firing when expected 2021-08-12 14:47:10 +01:00
Paulb23 ae4dcb8918 Cleanup and bind remaing methods in TextEdit 2021-08-12 11:43:35 +01:00
Paulb23 e60900a353 Make TextEdit cut, copy and paste overridable 2021-08-12 09:27:10 +01:00
Paulb23 809a32c045 Clean up and complete CodeEdit inspector and docs 2021-08-01 12:24:19 +01:00
Paulb23 dd5a37f556 Move symbol lookup into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 8f900ac178 Move line length guidelines into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 d1a1ad127e Move brace matching into CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 12f0053555 Move auto brace completion to CodeEdit 2021-08-01 12:06:33 +01:00
Paulb23 1a0cfc219b Move indent management to CodeEdit 2021-06-20 20:00:54 +01:00
Paulb23 5c618dd03d Move code folding into CodeEdit and hide line hiding API 2021-06-01 17:07:01 +01:00
Paulb23 c1b9971ad8 Move and expose Code Hint in CodeEdit 2021-06-01 15:38:45 +01:00
Paulb23 1c16673798 Move and expose AutoComplete in CodeEdit 2021-06-01 15:38:45 +01:00
Paulb23 680dc9e81a Add comment and string tracking to CodeEdit 2021-06-01 15:38:45 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Paulb23 7829fdc1d0 Add folding gutter to code_edit 2020-09-10 20:35:28 +01:00
Paulb23 4d7df24d46 Add main_gutter (breakpoints, bookmarks, execution lines) to code_edit 2020-09-10 20:35:28 +01:00
Paulb23 907f9f2a84 Changed line_edited_from(from) to lines_edit_from(from, to) 2020-09-10 20:35:28 +01:00
Paulb23 1353ed5e44 Added Line numbers to CodeEdit 2020-09-10 20:35:28 +01:00
Paulb23 a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00