Skip to content

[Bug] Perhaps not a bug, but what's going on with the minimap? #3

@sancarn

Description

@sancarn

Describe the bug

The minimap seems to highlight a bunch of different lines for seemingly no reason?

image

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 Function

Expected behavior

I would expect function declares are meant to be listed alone?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions