Autocomplete: current project AND all open files

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
luis
Addict
Addict
Posts: 3894
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Autocomplete: current project AND all open files

Post by luis »

I'm writing a library, the library is organized as a project, many files, etc.
Suppose my library is complete.
Now I want to write a program using that library.

I would like to be able to have this working configuration:

1) The project loaded, with ZERO files from it opened in the IDE, and some of the files in the project tagged as "Scan file for autocomplete".

2) Some tabs in the ide opened containing the sources of the new program calling code from the library.

3) If I type a procedure, macro, constant name in one of these tabs, the autocomplete WORKS for the names defined in the opened tabs AND in the opened project.


Now this is not possible, we have 4 options working as follow in my configuration:

Add Items from: the current source only
Autocomplete works only for what defined in the tab I'm editing..

Add Items from: the current project (if any)
Autocomplete does not works at all, I don't get autocompletion for what defined in the opened tabs or for what defined in the project.

Add Items from: the current project or all files (if none)
Autocomplete works only for what defined in the opened files, since the tabs I'm working on are not part of a project.

Add Items from: all open files
As above, autocomplete works only for what defined in the opened tabs, since the project files are not loaded.

The most close option is the last one, if I keep all the the files in the project opened in the ide.
That's what I would like to avoid. I would like to have only the files I'm working on opened (the NEW files for the NEW program USING the library), but I would like to use the "Scan file for autocomplete" feature from the project to get the benefit of autocomplete for what's defined inside it.

Another solution, horrid, for now is to duplicate the project, and add the new files I'm working on as part of the project, when they are not.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Autocomplete: current project AND all open files

Post by skywalk »

Did you also try creating a residents file for your unopened files' contents?
I don't use projects, but instead rely on all opened files for autocomplete.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
luis
Addict
Addict
Posts: 3894
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Autocomplete: current project AND all open files

Post by luis »

skywalk wrote:Did you also try creating a residents file for your unopened files' contents?
Residents are ok if what's inside them doesn't change.
While developing a library includes are a lot easier and quick to manage and even after that I prefer them to residents because in time I know I will end up changing something in the lib.

In any case, residents doesn't give autocompletion for procedures and macros, only constants and structures, so even using them doesn't solve the problem.
skywalk wrote:I don't use projects, but instead rely on all opened files for autocomplete.
I would like to avoid to keep 30+ files open in the editor only to get autocompletion when they are part of something I'm not working on. What I'm working on it's just using them. They waste screen space, resources, and get in the way while working.

As I said, this is practically already available.
When working on a project you can keep open only the 2-3 files you are working on and STILL GET AUTOCOMPLETION for the entire project contents. This is a really nice feature of projects.

I would just like that to be possible even when the file I'm working on is not a part of the project.
If the project is loaded, with zero of its files open, I would like to get the autocompletion for my open files and the files in the projects tagged for the the scan (see project proprieties).

It's just one more option to the 4 already available.
Last edited by luis on Wed May 22, 2013 4:51 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Autocomplete: current project AND all open files

Post by skywalk »

Sounds good to me.
When I struggle with the autocomplete for an unopened file, I [ctrl+dblclk] the xincludefile and it is added.
An extra step for sure.
My hesitation with projects was due to some weird icon errors and compiling non-project files while debugging new code.
That was back in v4.6 so maybe projects have improved.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Autocomplete: current project AND all open files

Post by Zach »

From what I have experienced.

While using ProGUI (DLL method), all I need to do is add "ProGUI_PB.pb" to my Project's file list. It doesn't even have to be open in the editor - and I get autocomplete.

Constants, Variables, Procedures, etc.

It works well enough for me
Post Reply