Page 1 of 1
Displayed Items: "current project or all files"
Posted: Fri Jun 11, 2021 6:22 am
by Cyllceaux
This does not work for modules.
easy to reproduce.
4 Files
File1: DeclareModule
File2: Module
File3, File4: Includes
File2 includes File1 in a Module. File 2 can use References of File1
File2 includes File3 and File4: File3 doesn't see anything of File2 and File1 but of File4, File2 doesn't see anything of File3. File4 only sees File3
File1.pb
Code: Select all
DeclareModule Test
#TEST1=1
EndDeclareModule
File2.pb
Code: Select all
Module Test
#TEST2=1
XIncludeFile "File3.pb"
XIncludeFile "File4.pb"
; #TEST1 can be use, and is shown in the Editor
; #TEST3 can be use, but is not shown in the Editor
; #TEST4 can be use, but is not shown in the Editor
EndModule
File3.pb
Code: Select all
; #TEST1 can be use, but is not shown in the Editor
; #TEST2 can be use, but is not shown in the Editor
; #TEST4 can't be use (worked as designed), but is shown in the Editor
#TEST3=1
File4.pb
Code: Select all
; #TEST1 can be use, but is not shown in the Editor
; #TEST2 can be use, but is not shown in the Editor
; #TEST3 can be use, but is not shown in the Editor
#TEST4=1
Re: Displayed Items: "current project or all files"
Posted: Fri Jun 11, 2021 5:41 pm
by helpy
It works as expected with 5.73 x64 on Windows 10!
Tested with and without project!
BUT:
PureBasic scans each file independently.
That means, that #Test3 and #Test4 are part of the global scope from the point of view of the autocomplete function.
==> Inside Module of File2 the editor does not see #Test3 and #Test4.
==> Outside Module of File2 (in global scope) the editor sees #Test3 and #Test4.
....
I never got this problem, because I do not include files inside modules

Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 6:02 am
by Cyllceaux
helpy wrote: Fri Jun 11, 2021 5:41 pm
It works as expected with 5.73 x64 on Windows 10!
Tested with and without project!
BUT:
PureBasic scans each file independently.
That means, that #Test3 and #Test4 are part of the global scope from the point of view of the autocomplete function.
==> Inside Module of File2 the editor does not see #Test3 and #Test4.
==> Outside Module of File2 (in global scope) the editor sees #Test3 and #Test4.
....
I never got this problem, because I do not include files inside modules
I understand you... this is not the point

Btw... I don't like Modules with more than 1.000 lines of code, but I have some with more of 10.000 lines. PB is slowing down extremely in that case.
My problem is, why sees File3 #TEST4, but File4 can't see #TEST3. Both are in a global scope
Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 9:07 am
by helpy
Cyllceaux wrote: Sat Jun 12, 2021 6:02 am
My problem is, why sees File3 #TEST4, but File4 can't see #TEST3. Both are in a global scope
I tested this case again with and without a project.
And on my system inside File4 the Editor displays #TEST3 in autocomplete list!
Are you using a PB project?
In the project settings, you can set an option for each file if it should be scanned or not.
Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 9:45 am
by Cyllceaux
helpy wrote: Sat Jun 12, 2021 9:07 am
Cyllceaux wrote: Sat Jun 12, 2021 6:02 am
My problem is, why sees File3 #TEST4, but File4 can't see #TEST3. Both are in a global scope
I tested this case again with and without a project.
And on my system inside File4 the Editor displays #TEST3 in autocomplete list!
Are you using a PB project?
In the project settings, you can set an option for each file if it should be scanned or not.
Yes... I created a new project to test this. I reinstalled PB again, reload the project... same problem
But... if you say this works always, but only not on my system... this thread can be close

Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 10:13 am
by mk-soft
If it gets stuck, it can also be due to Purebasic.pref. Reset this (rename or delete).
Folder Window: %Appdata%\Purebasic
Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 10:16 am
by helpy
Did you checked the project settings?

Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 10:36 am
by Cyllceaux
Yes... all of them are "yes"
Re: Displayed Items: "current project or all files"
Posted: Sat Jun 12, 2021 10:37 am
by Cyllceaux
mk-soft wrote: Sat Jun 12, 2021 10:13 am
If it gets stuck, it can also be due to Purebasic.pref. Reset this (rename or delete).
Folder Window: %Appdata%\Purebasic
I did... after deinstalling PB.