Scan includes files for autocomplete
Scan includes files for autocomplete
It would be great if PureBasic could scan "manually included" files for the autocomplete feature.
I know, that there is a switch in the project options dialog (scan file for autocomplete), so I do not need to open the file in the GUI. But the file have to be assigned as a project file.
Sometimes I use generic procedures which are not explicit part of the project file list (understand it as a kind of library). This files are located at a completely different directory and I include them via IncludeFile "...".
Regards, Kurzer
I know, that there is a switch in the project options dialog (scan file for autocomplete), so I do not need to open the file in the GUI. But the file have to be assigned as a project file.
Sometimes I use generic procedures which are not explicit part of the project file list (understand it as a kind of library). This files are located at a completely different directory and I include them via IncludeFile "...".
Regards, Kurzer
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Scan includes files for autocomplete
+1
Kukulkan
Kukulkan
Re: Scan includes files for autocomplete
+1
The best preparation for tomorrow is doing your best today.
Re: Scan includes files for autocomplete
Its impossible to accurately know which files are included until you compile the code. This is why projects exist, so you can tell the IDE which files belong together.
quidquid Latine dictum sit altum videtur
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Scan includes files for autocomplete
@Kermit
is it a problem to add "..\..\AllIncludes\myInclude.pbi" to the Project...?
is it a problem to add "..\..\AllIncludes\myInclude.pbi" to the Project...?
oh... and have a nice day.
Re: Scan includes files for autocomplete
No, its not a problem, even if it contradicts to my project-philisophy.Kaeru Gaman wrote:@Kermit
is it a problem to add "..\..\AllIncludes\myInclude.pbi" to the Project...?
But, you have to assign every single file to the project, because the scan did not work recursivley.
Example - Imagine the following situation:
MyOwnGadgets.pb -> this file includes the following files:
- MyOwnButton.pb
- MyOwnRequester.pb
- MyOwnImageGadget.pb
- MyOwnWhatever.pb
So MyOwnGadgets.pb acts as a library and the files it include are the 'functions' of the library.
But if I assign the MyOwnGadgets.pb to my project, I still have no autocomplete for all the procedures it includes.
Maybe my include/library-philisophy is bullsh**, but the desired feature request would also be an advantage for non-project based files.
@freak: Thats right, but what speaks against an internal include filelist for the IDE, which is updated every compile run?
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Scan includes files for autocomplete
you know I normally don't hasitate for harsh words, but this time you said it clearer than I would.kurzer wrote:Maybe my include/library-philisophy is bullsh**
I'd like to say, your concept calls for reconstruction.
indeed, at least an idea worth concidering.kurzer wrote:the desired feature request would also be an advantage for non-project based files.
@freak: Thats right, but what speaks against an internal include filelist for the IDE, which is updated every compile run?
oh... and have a nice day.
Re: Scan includes files for autocomplete
*sigh* Frogs!Kaeru Gaman wrote:you know I normally don't hasitate for harsh words, but this time you said it clearer than I would.kurzer wrote:Maybe my include/library-philisophy is bullsh**
I'd like to say, your concept calls for reconstruction.


Yes, I could place the code for all the own Gadgets in one include file... but behind this philisophy stays an idea (of course)

If I want to code an app with own Gadgets, but with minimum overhead, then I include every "own-gadget file" seperate if I need it.
In projects, where this overhead is not relevant I include the complete "library file" which includes all the own gadgets.
Do you have other suggestions?
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Scan includes files for autocomplete
to my knowledge, Procedures that are not called at all are not included.
one limitation: Procedures that are called from uncalled Procedures are included.
I'm not sure if it was improved meanwhile....
so I would concentrate on keeping the Call-Tree clean to make the compiler not include the not needed Procs, instead of splitting it into uncountable many single includes.
one limitation: Procedures that are called from uncalled Procedures are included.
I'm not sure if it was improved meanwhile....
so I would concentrate on keeping the Call-Tree clean to make the compiler not include the not needed Procs, instead of splitting it into uncountable many single includes.
oh... and have a nice day.
Re: Scan includes files for autocomplete
Hmm, it is worth thinking about.Kaeru Gaman wrote:so I would concentrate on keeping the Call-Tree clean to make the compiler not include the not needed Procs, instead of splitting it into uncountable many single includes.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Scan includes files for autocomplete
> @freak: Thats right, but what speaks against an internal include filelist for the IDE, which is updated every compile run?
That would just be an heuristic method as well. If it sometimes works and sometimes doesn't then it is of no real use. (Not speaking about all the bugreports we would get by people who think it does not work right)
That would just be an heuristic method as well. If it sometimes works and sometimes doesn't then it is of no real use. (Not speaking about all the bugreports we would get by people who think it does not work right)
quidquid Latine dictum sit altum videtur
Re: Scan includes files for autocomplete
Hm, now I'm confused and I dont undestand the problem. Let's start from scratch.freak wrote:That would just be an heuristic method as well. If it sometimes works and sometimes doesn't then it is of no real use. (Not speaking about all the bugreports we would get by people who think it does not work right)
Both, the sourcecode which is opened in the IDE and the source files which are assigned to a project have to be scanned for new procedures at a certain time.
Why not extend this scan to the files which are included in this files? Actually you have to scan the included files only the first time except they are open in the IDE.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Scan includes files for autocomplete
Example:
Which one would you scan? And how do you find the first file at all?
Keep in mind that constants can be defined on compilation via the commandline or the Compiler Options. The information about which file to use may not be in the code at all.
Lets say you have a solution to that problem. Consider then the following configuration:
FileA.pb (main file)
FileB.pb (included from FileA.pb)
FileC.pb (included from FileA.pb)
FileD.pb (included from FileC.pb)
Code: Select all
CompilerIf #DEBUG = 1
XIncludeFile #DebugDirectory + "Debug.pb"
CompilerElse
XIncludeFile "Normal.pb"
CompilerEndIf
Keep in mind that constants can be defined on compilation via the commandline or the Compiler Options. The information about which file to use may not be in the code at all.
Lets say you have a solution to that problem. Consider then the following configuration:
FileA.pb (main file)
FileB.pb (included from FileA.pb)
FileC.pb (included from FileA.pb)
FileD.pb (included from FileC.pb)
- First you edit FileA
From a recursive search the IDE could find/display info from all files correctly. - Now you edit FileB
There is no information inside FileB that tells the IDE that it is included into FileA. So all you get is stuff from FileB itself. - Now you edit FileC
Still, no way to reach FileA but FileD can be found. So you get the stuff from FileC and FileD here.
quidquid Latine dictum sit altum videtur
Re: Scan includes files for autocomplete
Remember than having a 'mostly' working feature is useless, as you will not trust it anymore once you will hit an issue.