AdaCore / gnatstudio

GNAT Studio is a powerful and lightweight IDE for Ada and SPARK.
399 stars 52 forks source link

Idea: suggestion for missing "with Ada.Strings.Fixed" and "Ada.Characters.Handling" #171

Open zertovitch opened 5 months ago

zertovitch commented 5 months ago

When you write a "Put_Line" without a "with Ada.Text_IO;", GNAT suggests, and GNAT provides the "wrench" for it, to add "with Ada.Text_IO; use with Ada.Text_IO;". It is super useful. In a similar way, I have more than often, since decades, the case where "To_Lower", "To_Upper" or "Trim" are not known to GNAT. It would be extremely cool to have a similar suggestion with an auto-fix with "with Ada.Characters.Handling; use Ada.Characters.Handling;" and "with Ada.Strings.Fixed; use Ada.Strings, Ada.Strings.Fixed;" depending on those function names (and perhaps others). Especially, "Ada.Characters.Handling" is not an obvious place to search for "To_Lower" and "To_Upper", so it would be welcoming for beginners.

AnthonyLeonardoGracio commented 4 months ago

Hello,

We are working on LSP codeActions in the Ada Language Server side for that. We will also provide a way to irectly import missing packages when using completion to import an invisible symbol: that would solve your issue.

Keeping you posted.

Regards,