Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GPS/Gnat Studio: Code completion with other projects

161 views
Skip to first unread message

John Perry

unread,
Jan 31, 2021, 8:52:43 PM1/31/21
to
Hi!

Suppose I've developed a package A, saved as a project. Now I'm working on package B. I make A available by specifying it in my gpr file, either as a with statement or by adding it to Source_Dirs. In package B I have the statement "with A;".

At this point, while I edit package B, Gnat Studio will code-complete any entity of package B, as well as any entity from the Ada standard library, but it won't code-complete entities from package A, such as A.Some_Feature.

How do I get Gnat Studio to do that?

thanks
john perry

Dmitry A. Kazakov

unread,
Feb 1, 2021, 2:52:02 AM2/1/21
to
It is a bug introduced in the latest version. Cross-referencing (it
seems more than just auto-completion affected) across packages worked
fine in earlier GPS versions.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

John Perry

unread,
Feb 1, 2021, 10:13:14 AM2/1/21
to
On Monday, February 1, 2021 at 1:52:02 AM UTC-6, Dmitry A. Kazakov wrote:
> It is a bug introduced in the latest version. Cross-referencing (it
> seems more than just auto-completion affected) across packages worked
> fine in earlier GPS versions.

Thank you very much. One place it fails for me is indeed the most recent Gnat Studio. However, I can't get it to work in a previous version, either, perhaps because I'm using the wrong method to include it. (GPS 2019, last one on Mac)

One thing I tried was

with "path/to/package/A.gpr";
project B is
-- etc.

Another thing I tried was

project B is
for Source_Dir use ("src","path/to/package/src");
-- etc.

Apparently neither of those does what I want. Does it look as if I am missing something?

Rod Kay

unread,
Feb 2, 2021, 6:00:22 PM2/2/21
to
You might try this ...

To enable 'Find All References' => Append 'GPS.LSP.ADA_SUPPORT=no' to ~/.gnatstudio/traces.cfg

... it should help with finding references and refactoring.

Stephen Leake

unread,
Feb 2, 2021, 6:27:58 PM2/2/21
to
John Perry <john....@usm.edu> writes:

> On Monday, February 1, 2021 at 1:52:02 AM UTC-6, Dmitry A. Kazakov wrote:
>> It is a bug introduced in the latest version. Cross-referencing (it
>> seems more than just auto-completion affected) across packages worked
>> fine in earlier GPS versions.
>
> Thank you very much. One place it fails for me is indeed the most
> recent Gnat Studio. However, I can't get it to work in a previous
> version, either, perhaps because I'm using the wrong method to include
> it. (GPS 2019, last one on Mac)
>
> One thing I tried was
>
> with "path/to/package/A.gpr";
> project B is
> -- etc.

What error message did this give?

You probably have to put the package directory in the environment variable
GPR_PROJECT_FILES.


> Another thing I tried was
>
> project B is
> for Source_Dir use ("src","path/to/package/src");
> -- etc.

What error message did this give?

--
-- Stephe

John Perry

unread,
Feb 3, 2021, 4:52:59 PM2/3/21
to
Wow, that worked. Can you explain why? I don't see the connection at all. (I don't know what "GPS.LSP" means, either.)

John Perry

unread,
Feb 3, 2021, 4:55:26 PM2/3/21
to
On Tuesday, February 2, 2021 at 5:00:22 PM UTC-6, roda...@gmail.com wrote:
...oddly, once I remove that file it still works. I know it wasn't working before; that's why I asked. Very confusing. I'll look into it more & report back.

Jérôme Haguet

unread,
Feb 12, 2021, 7:32:09 AM2/12/21
to

Shark8

unread,
Feb 12, 2021, 11:48:36 AM2/12/21
to
On Wednesday, February 3, 2021 at 2:52:59 PM UTC-7, john wrote:
> On Tuesday, February 2, 2021 at 5:00:22 PM UTC-6, roda wrote:
> > You might try this ...
> >
> > To enable 'Find All References' => Append 'GPS.LSP.ADA_SUPPORT=no' to ~/.gnatstudio/traces.cfg
> >
> > ... it should help with finding references and refactoring.
> Wow, that worked. Can you explain why? I don't see the connection at all. (I don't know what "GPS.LSP" means, either.)
I *think* it's "Language Server Plugin".
0 new messages