No Autocomplete - Include in module

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
macros
User
User
Posts: 80
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

No Autocomplete - Include in module

Post by macros »

Autocomplete does not trigger when an include is used in a module declaration
(Compiling works fine)

Example
Save as include.pbi

Code: Select all

Global Autocompletemeplease.i
Save as main.pb

Code: Select all

Module testAutocomplete
  Declare.i dummy()
EndModule

DeclareModule testAutocomplete
  IncludeFile "include.pbi"
  
  Procedure dummy()
    autocom
  EndProcedure
EndDeclareModule
Type the "p" after "autocom".

Expected behaviour: Autocomplete is offered if options in the preferences are set accordingly.
Observed behaviour: No autocomplete window opens.
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

Re: No Autocomplete - Include in module

Post by Justin »

It is by design, the autocomplete does not parse include files, only project files. And inside a module you have to convert the include to module, include it outside the module, add it to the project and 'usemodule' for the autocomplete to trigger.

It was requested among other things to improve modules but not implemented.
User avatar
macros
User
User
Posts: 80
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

Re: No Autocomplete - Include in module

Post by macros »

The include file is parsed for autocomplete if I place it outside a DeclareModule.

For now I used the workaround of copying the relevant declarations into the Module Header till I have finished writing it.
I cannot convert the include to a module, it contains numerous constant and prototype declarations and no executed code.
Well I could do it, but it would be silly, having a empty DeclareModule body. For now my workaround works too.

This should be an easy fix as includes in normal code work, so I hope it is implemented soon.
User avatar
macros
User
User
Posts: 80
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

Re: No Autocomplete - Include in module

Post by macros »

Because this currently drives me crazy I am placing a bug bounty of 30€ on this.
Will donate it as soon as I get my hands on a PB version where this works.

Feel free to message me when one is available.
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: No Autocomplete - Include in module

Post by Rinzwind »

This is a big oversight... autocomplete must parse include files too. Otherwise it becomes quite bothersome to split code in multiple files... We're all used to autocomplete.
Post Reply