Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Preview Build] SortHierarchicalSymbolsImpl throwing on "We didn't find the child's parent!" #2203

Open
6 tasks done
JustinGrote opened this issue Nov 30, 2024 · 1 comment
Labels
Issue-Bug A bug to squash.

Comments

@JustinGrote
Copy link
Collaborator

JustinGrote commented Nov 30, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with PowerShell Editor Services itself and does not reproduce in a standalone PowerShell instance, and is not an issue with my editor.
  • I have verified that I am using the latest version of PowerShell Editor Services.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Started having a crash in PSES on startup, not sure what's going on here, will investigate. More importantly, the exception didn't get written to the log, I had to flash-capture it from the console.

❯ Process terminated. Assertion failed.
We didn't find the child's parent!
   at Microsoft.PowerShell.EditorServices.Handlers.PsesDocumentSymbolHandler.SortHierarchicalSymbolsImpl(List`1 symbols, CancellationToken cancellationToken) in D:\PowerShellEditorServices\src\PowerShellEditorServices\Services\TextDocument\Handlers\DocumentSymbolHandler.cs:line 87
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

PowerShell Editor Services Version

HotReload Preview Build
@JustinGrote JustinGrote added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Nov 30, 2024
@JustinGrote JustinGrote changed the title SortHierarchicalSymbolsImpl throwing on "We didn't find the child's parent!" [Preview Build] SortHierarchicalSymbolsImpl throwing on "We didn't find the child's parent!" Nov 30, 2024
@JustinGrote JustinGrote removed the Needs: Triage Maintainer attention needed! label Nov 30, 2024
@JustinGrote
Copy link
Collaborator Author

JustinGrote commented Nov 30, 2024

Well now I can't reproduce it, @andyleejordan something to bang on. I was assisting with @tabs-not-spaces and had code something like this.

function Get-ProjectAccess {
    [cmdletbinding()]
    param(
        [parameter(Mandatory = $true)]
        [ArgumentCompleter({
            param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
            $script:Configuration = $script:Configuration ?? $(Get-EnvironmentConfiguration)
            Invoke-ProjectNameCompleter -WordToComplete $wordToComplete
        })]
        [string]$Project,

        [parameter(Mandatory = $true)]
        [string[]]$Database,

        [parameter(Mandatory = $false)]
        [ValidateSet('Read', 'ReadWrite')]
        [string]$AccessLevel = 'Read',

        [parameter(Mandatory = $false)]
        [ValidateRange(1, 12)]
        [int]$DeleteAfterHours = 2
    )
    try {
        $newUser = @{
            UserName         = "$($env:USER ?? $env:USERNAME)_Temp"
            Password         = (New-Guid).Guid
            DeleteAfterHours = $DeleteAfterHours
            Databases        = $(foreach ($db in $Database) { New-DbAccess -Project $Project -Database $db -AccessLevel $AccessLevel })
        }
        ## Send the request to the database api - we don't know how this works yet, so let's just display the request data.
        return $($newUser | ConvertTo-Json -Depth 10)
    }
    catch {
        Write-Warning $_.Exception.Message
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

1 participant