Patrick Meinecke

Results 430 comments of Patrick Meinecke

Hmm. I know on Windows finalizers *are* supposed to run when the process is closing, but iirc there is a timeout for the whole finalizer queue. So either that just...

The missing piece is a test `PSHost` that inherits `EditorServicesConsolePSHost` and overwrites `WriteLine` to something that just adds to a `StringBuilder`.

So here's a little editor command you can throw in your profile ```powershell using namespace System.Management.Automation.Language function global:Get-Cursor { [OutputType([System.Management.Automation.Language.IScriptPosition])] [CmdletBinding()] param() end { $psEditor.GetEditorContext().CursorPosition | ConvertTo-ScriptExtent | ConvertTo-ScriptPosition }...

> @SeeminglyScience The `.Ast.GetScriptBlock()` ❤️ yeah in this case that just makes it so the editor command stays in the session state (module) that's current. A little different from the...

> 1. Why do we need that override in the first place? Two reasons, broken up by platform: On Windows it's so we can make `ReadKey` cancellable, sorta. It's a...

Couldn't remember so I went to go test some things, and the biggest blocker I found pretty quickly is that `shift` on it's own returns as a key press (on...

> Do you mean use this to generate the tie-ins to Omnisharp ABCs? So interface everything (I'm sure the pattern has an actual name but I dunno) is a pattern...

> @SeeminglyScience looks like it's not hard-hanging, just a performance issue. Could this have to do with the marshaling still? Yep! In certain circumstances (like this one) it will timeout...

> Playing with that in a different ways - I guess the issue is, request is sent but no response because of "Access deny" issue in internal "System.IO" implementation for...

I think this line here might be the problem: https://github.com/Xrumet/PowerShellTools/blob/e577ed9ee77ef3b4e5d53acabf6d034416bb6fff/Draft/ConsoleApp2/Program.cs#L240 Starting the language server in an elevated process is going to make is so non-elevated processes are unable to access...