It is currently Thu Jan 28, 2021 3:09 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [SOLVED] AutoComplete and modules
PostPosted: Fri Apr 24, 2015 9:15 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Sep 18, 2013 11:54 am
Posts: 432
Location: France
Hi,

Maybe someone already said this on the forum, but when you have multiple files in a project, and a module for each file, and a common module ; all procedures called from the common module are not recognized by AutoComplete. That would be great to see that fixed :)


Last edited by Joubarbe on Sat Apr 25, 2015 11:12 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 3:15 am 
Offline
User
User

Joined: Wed Apr 15, 2015 5:14 am
Posts: 44
I'm not %100 sure this is what you are looking for but have a look in the preferences under autocomplete/displayed items.


Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 7:45 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Sep 18, 2013 11:54 am
Posts: 432
Location: France
I'm aware of that, I'm not looking for anything. I'm pretty sure it's a bug. The AutoComplete does not work at all in the case I described.

Common.pb :

Code:
DeclareModule Common

  Declare MyProcedure()

EndDeclareModule

DeclareModule UI
 
  UseModule Common

EndDeclareModule

Module Common

  Procedure MyProcedure()
    ; stuff
  EndProcedure

EndModule

XIncludeFile "UI.pb"


UI.pb :
Code:
Module UI
  ; if you try to call MyProcedure() from here, AutoComplete will not work - it will work however if you don't use "UseModule Common" and call Common::MyProcedure() ; but the point of having a common module is to avoid that.
EndModule


FYI, all the files are in a single project.


Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 8:36 am 
Offline
User
User

Joined: Wed Apr 15, 2015 5:14 am
Posts: 44
I see. (edit removed wrong answer ..sorry)
I just tried your code and it works for me. Autocomplete does see the module.


Last edited by sancho2 on Sat Apr 25, 2015 8:46 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 8:41 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Sep 18, 2013 11:54 am
Posts: 432
Location: France
Wot ?

That's what it does. It includes the Common module... "UseModule Common". That should work.


Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 8:58 am 
Offline
User
User

Joined: Wed Apr 15, 2015 5:14 am
Posts: 44
Looks like I'm losing all around on this one. It does work but you do have to qualify it with the module name, ie:
Code:
Common::MyProcedure()

Which makes the UseModule command redundant. Your point is valid, sorry about the confusion.


Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 11:06 am 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5818
Location: Germany
Its not a bug but rather a limitation of the way AutoComplete is implemented. I have written about this here: http://www.purebasic.fr/blog/?p=417

All you have to do is to repeat the UseModule keyword inside your Module to help the IDE understand the connection.

Code:
Module UI
  UseModule Common
 
  ; Now AutoComplete should work
EndModule

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject: Re: AutoComplete and modules
PostPosted: Sat Apr 25, 2015 11:12 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Sep 18, 2013 11:54 am
Posts: 432
Location: France
Great, thank you freak ! :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye