400 Commits

Author SHA1 Message Date
Eric Botcazou
c04c096013 Fix freezing issues coming from expression functions
The upcoming compiler change trades spurious errors (reject-valid bugfixes)
for valid errors (accept-invalid bugfixes), and now flags a few problematic
constructs in the codebase:

gps-editors.ads:1291:04: error: deferred constant "Nil_Editor_Mark" is frozen before completion
gps-editors.ads:1291:04: error: because expression of function "Create_Mark" is frozen here
gps-editors.ads:1291:04: error: as a primitive operation of type "Dummy_Editor_Location" frozen here
gps-editors.ads:1291:04: error: expression function "Create_Mark" is declared at line 1230
gps-editors.ads:1326:04: error: full constant declaration appears too late
gps-editors.ads:1587:04: error: deferred constant "Nil_Editor_Cursor" is frozen before completion
gps-editors.ads:1587:04: error: because expression of function "Get_Main_Cursor" is frozen here
gps-editors.ads:1587:04: error: as a primitive operation of type "Dummy_Editor_Buffer" frozen here
gps-editors.ads:1587:04: error: expression function "Get_Main_Cursor" is declared at line 1341
gps-editors.ads:1672:04: error: full constant declaration appears too late

language-abstract_language_tree.ads:503:04: error: deferred constant "No_Semantic_Node_Array" is frozen before completion
language-abstract_language_tree.ads:503:04: error: because expression of function "Children" is frozen here
language-abstract_language_tree.ads:503:04: error: as a primitive operation of type "Dummy_Semantic_Node" frozen here
language-abstract_language_tree.ads:503:04: error: expression function "Children" is declared at line 410
language-abstract_language_tree.ads:506:04: error: deferred constant "No_Semantic_Node_Array" is frozen before completion
language-abstract_language_tree.ads:506:04: error: because expression of function "Root_Nodes" is frozen here
language-abstract_language_tree.ads:506:04: error: as a primitive operation of type "Dummy_Semantic_Tree" frozen here
language-abstract_language_tree.ads:506:04: error: expression function "Root_Nodes" is declared at line 477
language-abstract_language_tree.ads:509:04: error: full constant declaration appears too late

xref.ads:367:13: error: this primitive operation is declared too late
xref.ads:371:13: error: this primitive operation is declared too late
[...]

There is a chicken-and-egg issue in language-abstract_language_tree.ads,
whereby the completions of the constants at the end of the file freeze
each other, so there is no legal declaration order for the completions.
Therefore one of them is turned into a function (which is completed by
an expression function) to break the circularity.

Issue: eng/toolchain/gnat#1701
2026-01-17 11:36:22 +01:00
Anthony Leonardo Gracio
11672bc929 Update copyright year for GS sources
(no-issue-check)
2026-01-05 12:41:13 +00:00
Boulanger
9acb839117 Revamp the source editor formatting provider
Create one for the construct engine and put it as the same level
as the LSP one. Both providers are supporting two requests:
OnTypeFormatting and OnRangeFormatting. There is no more concept
of indent vs format: these are internal settings/preferences
inside the providers.

Create preferences to choose the provider for each requests.
Create a preference to not move the cursor during formatting.

For eng/ide/gnatstudio#522
2025-05-14 11:30:03 +02:00
Nicolas Setton
513438ffd6 Call the build mode "Coverage" rather than "cov"
For homogeneity with other modes.
2025-04-25 09:42:14 +00:00
Nicolas Setton
c67b86e41b Add a build mode for coverage information
Initial change to introduce a "cov" build mode.

For #457
2025-04-25 09:42:14 +00:00
Boulanger
de01bd361a Protect interpolation character from autocasing
For Casing On_The_Fly and End_Of_Word Change "Word_Added"
to check the newly added character after the word.
It handles adding a '"' after 'f'.

For Casing End_Of_Line, change the Ada language to protect 'f"'.

Add a test.

Closes eng/ide/gnatstudio#496
2025-02-24 15:47:38 +00:00
Anthony Leonardo Gracio
084d95d137 Revert "Protect interpolation character from autocasing"
This reverts commit 3e04037912.
2025-02-21 13:25:32 +00:00
Boulanger
3e04037912 Protect interpolation character from autocasing
For Casing On_The_Fly and End_Of_Word Change "Word_Added"
to check the newly added character after the word.
It handles adding a '"' after 'f'.

For Casing End_Of_Line, change the Ada language to protect 'f"'.

Add a test.

Closes eng/ide/gnatstudio#496
2025-02-18 13:51:24 +00:00
Andry Ogorodnik
a7240230d1 Preventing an exceptions when first symbol is '
For eng/ide/gnatstudio#444
2024-12-05 09:13:06 +00:00
Maxim Reznik
b5de2a51f4 Fix formating a code with square brackets.
```ada
   function Fun_1 return String is
     ['a', 'b', 'c'];
```

Here expression function returns an array aggregate.

Closes #308
2024-08-19 15:07:16 +03:00
Boulanger
ea4c9d139a Filter pretty print preferences depending on the engine
Rename Ident_Casing into Identifier_Casing because it was
to close to Indent_Casing.

Include a test.

Closes eng/ide/gnatstudio#140
2024-07-17 13:07:24 +00:00
Vadim Godunko
cce69b3b56 Remove duplicate dependency from gtkada. 2024-07-16 06:04:02 +00:00
Maxim Reznik
b755954bd3 Fix Ada_Analyzer to have correct line number
when it goes backward while searching for aspect bounds.

Fixes: #312
2024-05-21 16:26:06 +00:00
Boulanger
c1c25b755e Wrong ASCII.HT width in Search Module
Doing a search within an editor with ASCII.HT will create invalid
message hightlighting. GPS.Search module is too far from
the concept of Editor_Buffer and visible_column so remove any
reference of it.

Add a test.

eng/ide/gnatstudio#34
2023-07-20 13:03:18 +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
Adrien Boulanger
603d847ee1 VB24-022: Improve block highlighting detection
Improve detection of "foo : declare/begin".
Add a test.

Change-Id: I39873d896ce61ff31305c9caadc9b1fd7a093699
2022-11-29 09:33:43 +00:00
Vadim Godunko
cd640243cd Remove unused code.
(no-tn-check)

Change-Id: Icb8b4076dd03899a5badd232bf8a31a8a79f3da1
2022-10-17 23:59:41 +04:00
Anthony Leonardo Gracio
b23b9e2ce1 V818-002: Use a colored icon for snippet completion icon
Change-Id: Ib5b300b5fb7c623359f4a79748b08cb24657cd1d
2022-08-18 10:57:56 +02:00
Vadim Godunko
f55e593f60 V331-019 Remove unused code.
Change-Id: I6228dd2d83d108398b3205667e5b89f9c23435fb
2022-04-07 15:34:39 +00:00
Anthony Leonardo Gracio
363fbebff5 V103-022: Fix warnings on edge
Change-Id: I235bde9067e4f28e22d987faea7746063c3151fb
2022-01-10 15:09:38 +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
Nicolas Setton
fd3c09e743 UC13-045 Add missing subprogram declarations
Change-Id: I8c30bef287a60836e06758bb2bb05e8d45d08dde
2021-12-16 09:42:54 +00:00
Arnaud Charlet
2eeb4f4fad Add support for indentation and []
* ada_analyzer.adb (Next_Word): Factorize handling of () and reuse the
  code (with small adaptations) for [].

TN: UC13-045
Change-Id: Ib097bcdbae567012ee65929c434d639c174ac9aa
2021-12-15 16:50:50 +00:00
Adrien Boulanger
aed8b5f25b UC13-021: Fix -gnatwr warning
Change-Id: I602ba1b6f3961af2aca106a186fb48c5303c7486
2021-12-14 15:06:17 +01:00