91 Commits

Author SHA1 Message Date
Maxim Reznik
0fc219f100 Fix search path order in GPR server
to make it honor GPR_PROJECT_PATH priority.
2026-01-20 12:48:50 +00:00
Anthony Leonardo Gracio
b2f0338734 Handle source file mentions for GPR textDocument/definition
Querying 'textDocument/definition' on a source file mention
in a GPR file (e.g: 'for Main use ("main.adb")' now opens
the mentioned source file.

For eng/ide/ada_language_server#1733
2026-01-19 12:45:12 +00:00
Anthony Leonardo Gracio
4094bd6419 Adapt to new GPR2 API
The Current_Directory parameter of the Default_Search_Paths
function has been removed.

For eng/ide/ada_language_server#1752
2026-01-02 15:46:30 +00:00
Anthony Leonardo Gracio
811b0604ce Handle Clean, Format, Check and Emulator packages
For tool switches completion.

Adapt the Python script to handle more switches formats
(e.g: switches with a short and long version, like '-v,
--verbose').

For eng/ide/ada_language_server#1741
2025-12-19 09:06:30 +00:00
Anthony Leonardo Gracio
8cfac45f07 Add labelDetails to completion switches
If the client supports it, which is the case of VS Code.

labelDetails are displayed in gray, next to the completion
item's label: displaying the doc here gives a preview to
the user, which is particularly useful when trying to
understand what the selected switch is doing.

Add a test.

For eng/ide/ada_language_server#1741
2025-12-18 11:39:54 +00:00
Anthony Leonardo Gracio
8de8a243b0 Handle 'Builder' package in tool switches completion
And refine the snippet creation logic, by handling
more formats (e.g: '--db dir').

For eng/ide/ada_language_server#1741
2025-12-18 11:39:54 +00:00
Anthony Leonardo Gracio
d54fa4f711 Add final tab stop after GPR tool switch snippets
This is more user-friendly when the user wants to specify
several switches in a row.

For eng/ide/ada_language_server#1741
2025-12-18 11:39:54 +00:00
Anthony Leonardo Gracio
0754a214e8 Create snippets for GPR tool switches with parameters
For eng/ide/ada_language_server#1741
2025-12-15 11:27:49 +00:00
Anthony Leonardo Gracio
66aa3be3d3 Associate GNATprove switches to Prove package
Instead of 'Analyzer', which is for GNAT SAS.

For eng/ide/ada_language_server#1741
2025-12-12 14:49:54 +00:00
Anthony Leonardo Gracio
ea2af3bbd4 Few improvements to GPR tool switches completion
* Trigger it only if 'use' has been specified after
  Default_Switches or Switches

* Handle concatenation constructs
  (e.g: 'for Default_Switches ("ada") use Var1 & Var2 & (')

* Add more tests

For eng/ide/ada_language_server#1741
2025-12-11 15:19:29 +00:00
Andry Ogorodnik
1f29c2cab8 Added extendedProject field for locations
To separate locations for the root project and the extended project

For eng/ide/ada_language_server#1739
2025-12-03 16:20:23 +02:00
Anthony Leonardo Gracio
38743e231c Provide completion help for tool switches in GPR files
The database is created via a Python script that parses the
--help output of tools, and encapsulates it in a JSON-structured
string database in Ada.

The GPR file parser has been modified to handle completion for
the Default_Switches and Switches attributes inside packages,
and propose completion when available.

For eng/ide/ada_language_server#1741
2025-11-28 16:22:54 +00:00
Boulanger
a6defb6f92 Align Position and index of Indent_Array
Avoid the off by 1 when computing the indentation of a line using
the array. And move the -1 to the fallback internal computation.

Adapt test because rangeFormatting in fallback mode is also
indenting the current line
2025-11-28 10:15:35 +00:00
Anthony Leonardo Gracio
7e95b400e6 Use fallback indenter for textDocument/onTypeFormatting
For eng/ide/ada_language_server#1529
2025-11-18 17:47:32 +00:00
Anthony Leonardo Gracio
b40306cfef Parse configuration on initialize request
For eng/ide/ada_language_server#1529
2025-11-18 17:26:13 +00:00
Anthony Leonardo Gracio
3ef7ee2bf9 Use fallback indenter for textDocument/formatting request
To format entire GPR files.

For eng/ide/ada_language_server#1529
2025-11-12 14:08:02 +00:00
Anthony Leonardo Gracio
f44bcd9940 Use the fallback indenter for GPR rangeFormatting
For eng/ide/ada_language_server#1529
2025-11-12 09:42:36 +00:00
Javier Miranda
4896e0f413 Fix sources after enforcing RM 8.6(27.1) in the compiler
* lsp-gpr_handlers.adb (Get_Parsed_File): Add explicit type conversion.
* lsp-default_message_handlers.adb (Initialize): Add explicit type conversion.

For eng/toolchain/gnat#1292
2025-10-04 11:37:23 +00:00
Elie Richa
84714a05d7 Remove context-specific logic from Alire package
For eng/ide/ada_language_server#1661
2025-05-14 14:04:26 +00:00
Boulanger
893923eb62 Improve settings related to diagnostics
Add setting to control "gpr file diagnostics"

Automatically refresh all the diagnostics when changing the
settings.

Add a test.

For eng/ide/ada_language_server#1455
2025-03-07 09:48:59 +00:00
Elie Richa
2ca475a0cf Remove Alire environment setup from client initialization 2025-03-05 14:20:47 +00:00
Ronan Desplanques
32710f2bf7 Initialize file versions from didOpen argument
Before this patch, the language server initialized versions of all newly
opened file to 1. However, the language server protocol defines a
parameter for didOpen that says that the client gets to decide the
initial versions of opened files. One client, namely Helix 25.1, passes
an initial value of 0 which caused e.g. renaming a variable right after
opening a file to fail.

This patch makes the initial value of versions the one that's passed by
the client.
2025-02-21 17:16:50 +01:00
Maxim Reznik
ad94ba81a6 Semantic tokens request for GPR files
Refs #1230
2025-02-11 12:18:50 +02:00
Anthony Leonardo Gracio
3afbf62936 Add a new diagnostic source for Alire issues
This source publishes diagnostics on the alire.toml file in
case of errors found while trying to setup an Alire project
(e.g: an alire.toml file is present but 'alr' is not available
in the user's PATH).

Add a test for this.

For eng/ide/ada_language_server#1533
2025-02-10 13:14:33 +00:00
Boulanger
0ebf6bd4ba Send LogMessages for invalid Ada configurations
- Unknown attributes
- Casing Issues
- Wrong values
- Invalid json configuration file

Also trace them.

Add tests.

Closes eng/ide/ada_language_server#1516
2025-01-23 11:50:38 +01:00