Commit Graph

2839 Commits

Author SHA1 Message Date
Andry Ogorodnik
d0cf42f5fe Misplacement of pragma when using GNAT SAS Annotate 2024-10-16 10:16:16 +00:00
Vadim Godunko
342543ccc1 Internationalization subprogram with Virtual_String...
... and fix to translate complete messages, not just first line.
2024-06-26 09:36:29 +00:00
Anthony Leonardo Gracio
cf8ba1acbd Fix style issues
For eng/ide/ada_language_server#1159
2024-06-06 08:57:32 +00:00
Anthony Leonardo Gracio
7200a946c5 Avoid moving the cursor on TextEdits
For that add a procedure that allows to temporarily disable
moving the cursor in GPS.Editors, and use it by default when
applying TextEdits.

For eng/ide/ada_language_server#1159
2024-06-06 08:57:32 +00:00
Adrien Boulanger
0817773ba6 Revert "Merge branch 'topic/gs.192.python_3_11_transition' into 'master'"
This reverts merge request !422
2024-03-08 09:54:48 +00:00
Boulanger
9f24eede8b Fix missing GIL locks detected by python 3.11 transition
See comment from dictobject.h:
bpo-40839: Before Python 3.10, it was possible to call
PyDict_GetItem() with the GIL released.

eng/ide/gnatstudio#192
2024-03-06 17:10:30 +01:00
Anthony Leonardo Gracio
7c1ba23818 Revert "Merge branch 'topic/gs_56_bookmark_leaking_buffer' into 'master'"
This reverts merge request !195
2023-09-08 10:59:06 +00:00
Boulanger
64ac98f85a Remove Open_Buffer from Editor_Buffer_Factory
Opening a buffer without a view leaves the responsibility to the
caller to close the buffer manually.
=> this is unsafe: either we are closing a buffer shared
somewhere else or forgetting to close it (= leaking it)

The solution is to always use Buffer_Holder.
2023-09-07 11:37:05 +02:00
Nicolas Setton
f7c11441e6 W322-018 Introduce a cache for 'finding file in project'
The operation to find a file in the project from a base
name is very costly. Add a local cache in the Project_Registry
to alleviate the issue.

Make GPS.Kernel.Create take advantage of this cache in the
default lookup cases.

Use the call that leverage this cache when processing
the compiler output, and when applying codefix messages.

This reduces the import of 10000 messages on the same file
from 18s to 3s on my machine.

Add a test to check this scenario.
2023-03-30 12:47:33 +00:00
Adrien Boulanger
4d9d58a0e1 W228-019: Remove redundant parentheses
Found by -gnatyz
2023-02-28 16:36:38 +01:00
Anthony Leonardo Gracio
41c30ab309 Update copyright year (no-tn-check)
Change-Id: Ie2cf22f9729f30d2228572a7296c23889be4c563
2023-01-03 11:39:28 +01:00
Anthony Leonardo Gracio
e0139f95da T512-045: Include .gpr project files to search contexts
Add an automatic test.

Change-Id: I8ee7e2c689cd19024c0605387b4c959d7de9f7af
2022-07-12 11:52:55 +02:00
Adrien Boulanger
8d588bfb0c S712-022: Python leaks related to FileLocation
Each FileLocation was leaking a File: they were keeping a pointer
to File without using any proxy to release them.
Break the dependency and only create the File from the FileLocation
when needed.

Add a test.

Change-Id: I1df713a7c0e6cc54f7c4912b803247b3189dcd92
2022-04-11 15:54:11 +00:00
Adrien Boulanger
1804f192f3 S712-022: Fix over-referenced Python object by Ada
Add free for Callback_Data/Subprogram_Type/List_Instances
Fix ownership transfer issue for Monitored_Command.
Fix over-referenced on widget by python (Editor_Overlay)

Add a test.

Change-Id: I5f6447e37928535f2b7085bcd1b102ee28e31c33
2022-03-31 12:34:25 +00:00
Anthony Leonardo Gracio
af4c8f2d41 Update copyright year
(no-tn-check)
(no-precommit-check)

Change-Id: Id71d3f84cd6ab219a37821da1460038f4eea525c
2022-01-03 15:09:31 +01:00
Adrien Boulanger
40e2e9b505 UA22-002: Improve undo of workspaceEdits
- Create a group to "undo" at once a workspaceEdits on a file
- If the queue is not empty "undo" the last group which will
always conrespond to the workspaceEdits. If not then the buffer
is closed or has been closed and use the generated reverse
workspaceEdit.

Add a test.

Change-Id: Ifd001f50df7ed632b75741fef2d05293963f2fca
2021-12-21 15:28:17 +00:00
Adrien Boulanger
f414ee4ba5 U922-018: Reintroduce autoclose for Holder_Buffer
This is now properly checking if a view has been opened since and
thus is not closing it.

Add tests.

Change-Id: I8690abe76711e29f5641442556a88a6185af1791
2021-09-28 16:48:07 +02:00
Adrien Boulanger
587a9f4925 U504-030: Improve codeaction feedback
- Show a task with the codeaction command name
- Add messages to track the modification in the Messages view
- Allow undo/redo of workspaceEdit by adding the concept of global
command in Commands.Controls
- Reuse an existing hidden (Pure) buffers when opening a file if
any.
- Fix invalid closing of buffer when the first reference was stored
inside a Buffer_Holder see below a bogus sequence:
  * create a buffer_holder which opens the buffer without a view
  * open a view via the Open File menu
  * destroy the buffer_holder => it will close the view

Add tests

Change-Id: I215c6df2186c9c41c9e532c4b667bf95e37bf76d
2021-08-31 17:19:08 +02:00
Anthony Leonardo Gracio
bd635624db U319-012: Add a new parameter to GPS.EditorView.center
This allows to control whether we always want to center the location
in the editor view, or just make sure it's visible.

Use this new parameter for SPARK counter examples.

(no-precommit-check)

Change-Id: I948dda4ab6a45985bb863059b653f331ba93d994
2021-03-24 12:01:11 +01:00
Anthony Leonardo Gracio
7485ccd36d SA11-032: Add possibility to lock editors on given position
A new 'lock or unlock current editor' action has been added, allowing
users to lock a given editor at a gven position.

Locked editors are still navigatable manually but are insensitive to
all 'jump to code' events, such as clicks in the Locations view, navigation
actions (find all refs, goto declaration etc.), clicks on the Call Trees
view, in the Call Stack view etc.

Two tests that cover most use-cases have been added.

(no-precommit-check)

Change-Id: If083f013ff3c09a0ee01b39b1a66a23d641a159f
2021-03-11 12:27:10 +01:00
Andry Ogorodnik
014737047b U208-048 Corrections for lines folding/unfolding
Depends-On: Iab4d0ae9e6c023c03d0936a1e40207a69cc502dc
Change-Id: I0277d7ddc581639dbf70ee814c1002e3f2473fa5
2021-02-18 16:52:23 +01:00
Andry Ogorodnik
1f927a3008 U113-070 'Format selection' action description has been updated
Dummy_Editor_Location.Line & Column methods have been replaced
 by expression functions.

Change-Id: Id19a4d6f365dd0607d40f77b57105e6ec44412a1
2021-02-18 12:48:25 +01:00
Andry Ogorodnik
bd9b24afe5 TC14-011 Tabs and LSP.
Depends-On: Ifdf2000099fe9f7d425bb93bceb68ae605770977

Change-Id: Ib1169b2619b9f726c7bfd314162a86f27716eb14
2021-01-27 12:02:32 +02:00
Anthony Leonardo Gracio
63c2e9d9c9 Update copyright year
(no-tn-check)
(no-precommit-check)

Change-Id: I50abdaba131d76d914f1df9a53f013ec8f48ca68
2021-01-11 17:22:37 +01:00
Nicolas Setton
4771cb9e65 S730-054 Add missing calls to scroll the cursor online
In these cases:
  - in reaction to a graphical key press
  - when deleting interactively

We're still missing scrolls in reaction to interactive Cut
and Paste; this will be done in a subsequent change.

To support this, add a new primitive "scroll_to_cursor_location"
to the EditorView class.

Change-Id: I169d0d49994b49a174515558cec6512fa743bad6
2020-12-15 14:23:15 +01:00