[Done] No Autocomplete Popup

Post bugs related to the IDE here
novablue
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Nov 27, 2016 6:38 am

[Done] No Autocomplete Popup

Post by novablue »

On PB 6.10 Beta 7

When i write "MyModule::" normally the autocomplete list would pop up right away but it only does now when i type the first letter. The same happens with structured objects and others.

Code: Select all

DeclareModule MyModule
	Declare.i Test()
EndDeclareModule

Module MyModule 
	
	Procedure.i Test() 
    	
    EndProcedure

EndModule

MyModule::
fryquez
Enthusiast
Enthusiast
Posts: 391
Joined: Mon Dec 21, 2015 8:12 pm

Re: No Autocomplete Popup

Post by fryquez »

AutoComplete.pb --> AutoComplete_AddFromSorted()

For empty Prefix$, RadixEnumerateAll needs to be called.

Code: Select all

Procedure AutoComplete_AddFromSorted(*Parser.ParserData, Prefix$, *Ignore.SourceItem, SingleModuleOnly)
  
  If *Parser\SortedValid
    For Type = 0 To #ITEM_LastSorted
      If AutocompleteOptions(Type) And Type <> #ITEM_Constant ; constants are separate
        
        If Type = #ITEM_DeclareModule
          ; module names are indexed in the main module
          ; do not show modules if a prefix:: is provided before the word
          If SingleModuleOnly = 0
            RadixEnumeratePrefix(*Parser\MainModule\Indexed[Type], Prefix$, *AutoCompleteItems())
            ForEach *AutoCompleteItems()
              If *AutoCompleteItems() <> *Ignore
                AutoComplete_AddItem(*AutoCompleteItems())
              EndIf
            Next *AutoCompleteItems()
          EndIf
          
        Else
          ; other stuff
          ForEach AutoCompleteModules()
            
            If Prefix$ <> ""
              RadixEnumeratePrefix(*Parser\Modules(UCase(AutoCompleteModules()))\Indexed[Type], Prefix$, *AutoCompleteItems())
            Else
              RadixEnumerateAll(*Parser\Modules(UCase(AutoCompleteModules()))\Indexed[Type], *AutoCompleteItems())
            EndIf
            
            ForEach *AutoCompleteItems()
              If *AutoCompleteItems() <> *Ignore
                AutoComplete_AddItem(*AutoCompleteItems())
              EndIf
            Next *AutoCompleteItems()
          Next AutoCompleteModules()
          
        EndIf
      EndIf
    Next Type

  EndIf
  
EndProcedure
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] No Autocomplete Popup

Post by Fred »

Fixed, thanks for the fix !
Post Reply