-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Describe the bug
The minimap seems to highlight a bunch of different lines for seemingly no reason?
E.G. Each accChild ... and Each accDesc ... and length > 0 and index < length
I imagine these aren't arbitrary... But not sure.
To Reproduce
I opened stdAcc with the extension
Code (if relevant)
For instance:
Public Function FindFirst(ByVal query As stdICallable, optional byval searchType as EAccFindType=EAccFindType.DepthFirst) As stdAcc
Dim stack() As tFindNode
ReDim stack(0 To 0)
stack(0).initialised = true
stack(0).depth = 0
Set stack(0).element = Me
Dim length As Long: length = 1
Dim index As Long: index = -1
'Bind globals to query
Call BindGlobals(query)
'Loop over the stack/array
While length > 0 And index < length
Dim part As tFindNode
select case searchType
case EAccFindType.DepthFirst
'Depth first search, so pop the item out of the stack
part = stackPopV(stack,length)
case EAccFindType.BreadthFirst
'Breadth first search, get item directly out of array, no need to change array size
index = index + 1
part = stack(index)
case else
Err.Raise 1, "stdAcc#FindFirst", "Invalid search type given. Please use EAccFindType"
end select
With part
If not .initialised Then Exit Function
'Run query and test options
Select Case query.Run(.element, .depth)
Case EAccFindResult.NoMatchFound
'Nothing found, search descendents
Dim child As stdAcc
For Each child In part.element.children
Call stackPushV(stack, length, CreateFindNode(.depth + 1, child))
Next
Case EAccFindResult.MatchFound, True, EAccFindResult.MatchFoundSearchDescendents
'Found, return element
Set FindFirst = .element
Exit Function
Case EAccFindResult.NoMatchCancelSearch
'Nothing found, cancel function
Set FindFirst = Nothing
Exit Function
case EAccFindResult.NoMatchSkipDescendents
' Nothing found, don't search descendents
End Select
End With
'Just make sure no freezing occurs
DoEvents
Wend
'Else set to nothing
Set FindFirst = Nothing
End FunctionExpected behavior
I would expect function declares are meant to be listed alone?
Metadata
Metadata
Assignees
Labels
No labels
