Coder Social home page Coder Social logo

Comments (12)

strxngewxrld avatar strxngewxrld commented on June 26, 2024 2

@JustinGrote, @andyleejordan I personally think that's a cool feature for many applications. For example this could be the foundation for a new Out-GridView like function that works inside DevContainers, remote sessions, etc. Also good for reporting or even building small applications like with WinForms back in the days.

from vscode-powershell.

JustinGrote avatar JustinGrote commented on June 26, 2024 2

@strxngewxrld when that code was written, webviews didn't exist in vscode, they do now:
https://code.visualstudio.com/api/extension-guides/webview

So that would be a better route. As a perhaps future enhancement, the PS extension could facilitate starting a webview from a PowerShell script that hosts a Pode instance or whatnot as a go forward approach.

from vscode-powershell.

JustinGrote avatar JustinGrote commented on June 26, 2024 1

Perhaps the community isn't aware of this feature at all? It is only mentioned in the 1.4.0 release notes and in an older issue about the possibility of adding css/js support. I stumbled upon this feature while doing some other research.

So I'm notorious for being the one person who was using X feature in a project and now it can't be cut. I was there when this was released, and I can tell you that the underlying API was so locked down that it was borderline useless and even I couldn't get anything useful working. It's one of those things that only really worked if you were shipping an extension with static files.

I'm sure some similar in theme commands could be made with the newer APIs but it'd be a completely different command shape so it becomes more of a feature request than a bug. I'd also personally say that it would likely be too much code to review and maintain even if it was graciously done as a PR by the community.

This is another scenario where it would be most ideal if we instead had a way for folks to make extensions that can interact with the PSES runspace in some way. That would let the community implement their own extension to provide that functionality. This is a long term plan of mine but it's not funded atm and my free time is a little short for the time being.

Agreed, being able to submit stuff to the PSES runspace "pipeline" and get serialized/jsonified stuff back over some kind of IPC would be great, I know the scaffolding for the plugin API is there, but all you can really do at this point is get the version of PS in use (which Pester Tests does in fact register and use so its background version matches what PSES is using)

Pester tests has a library that does this very thing that I eventually plan to spin out into its own NPM package https://github.com/pester/vscode-adapter/blob/main/src/powershell.ts

from vscode-powershell.

JustinGrote avatar JustinGrote commented on June 26, 2024

@strxngewxrld thanks for the report! These were implemented a long time ago before a major rewrite and likely don't have any tests and were broken as a result.

@andyleejordan is this something to fix or deprecate?

from vscode-powershell.

andyleejordan avatar andyleejordan commented on June 26, 2024

Unfortunately I would probably lean toward deprecating given that these have probably been broken for a long time and not reported as such until now. That said, if you can track down the last known working version of the extension that would go a long way toward us being to fix them instead.

from vscode-powershell.

strxngewxrld avatar strxngewxrld commented on June 26, 2024

Perhaps the community isn't aware of this feature at all? It is only mentioned in the 1.4.0 release notes and in an older issue about the possibility of adding css/js support. I stumbled upon this feature while doing some other research.

I tested a lot of extension versions with the same vs code version now and never got the feature to work:

VS Code 1.85.1
pwsh extension 1.4.0
pwsh 5.1.17763.5202

[Extension Host] stack trace: TypeError: The "cb" argument must be of type function. Received undefined
    at maybeCallback (node:fs:189:3)
    at Object.appendFile (node:fs:2298:14)
    at Logger.writeLine (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:143:16)
    at Logger.writeAtLevel (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:52:18)
    at Logger.write (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:61:14)
    at c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\session.ts:341:30
w @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
mainThreadExtensionService.ts:81 [ms-vscode.PowerShell]The "cb" argument must be of type function. Received undefined
$onExtensionRuntimeError @ mainThreadExtensionService.ts:81
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
mainThreadExtensionService.ts:82 TypeError: The "cb" argument must be of type function. Received undefined
    at maybeCallback (node:fs:189:3)
    at Object.appendFile (node:fs:2298:14)
    at Logger.writeLine (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:143:16)
    at Logger.writeAtLevel (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:52:18)
    at Logger.write (c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\logging.ts:61:14)
    at c:\Users\user1\.vscode\extensions\ms-vscode.powershell-1.4.0\src\session.ts:341:30

VS Code 1.85.1
pwsh extension 1.4.3
pwsh 5.1.17763.5202

[Extension Host] rejected promise not handled within 1 second: Error: command 'vscode.previewHtml' not found
w @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
console.ts:137 [Extension Host] stack trace: Error: command 'vscode.previewHtml' not found
    at k.n (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12339)
    at k.executeCommand (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12268)
w @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
log.ts:441   ERR command 'vscode.previewHtml' not found: Error: command 'vscode.previewHtml' not found
    at k.n (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12339)
    at k.executeCommand (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12268)

VS Code 1.85.1
pwsh extension 1.5.0 / 1.12.1
pwsh 5.1.17763.5202

console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: command 'vscode.previewHtml' not found
w @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
console.ts:137 [Extension Host] stack trace: Error: command 'vscode.previewHtml' not found
    at k.n (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12339)
    at k.executeCommand (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12268)
w @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1148
fire @ event.ts:1179
fire @ ipc.net.ts:650
x.onmessage @ localProcessExtensionHost.ts:374
log.ts:441   ERR command 'vscode.previewHtml' not found: Error: command 'vscode.previewHtml' not found
    at k.n (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12339)
    at k.executeCommand (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1538:12268)

VS Code 1.85.1
pwsh extension 2019.5.0
pwsh 5.1.17763.5202

No service worker controller found. Waiting for controllerchange.

I have also looked in the source code of the extension versions, but haven't found any clue. @andyleejordan would it be possible for me to take a look into the Microsoft.PowerShell.EditorServices.VSCode.dll for further investigation?

from vscode-powershell.

andyleejordan avatar andyleejordan commented on June 26, 2024

Thanks so much for your testing! It looks like the features were implemented against APIs in VS Code that have since been removed (e.g. vscode.previewHtml) which unfortunately makes this much harder to bring back.

from vscode-powershell.

andyleejordan avatar andyleejordan commented on June 26, 2024

Info I found on its removal/deprecation: microsoft/vscode#62630

from vscode-powershell.

andyleejordan avatar andyleejordan commented on June 26, 2024

It looks like Tyler got the CustomViews migrated to the new API but the ContentView stuff was missed: #1602

from vscode-powershell.

SydneyhSmith avatar SydneyhSmith commented on June 26, 2024

Given that the apis got deprecated, and we don't have the resources to maintain in in the current state our plan is to remove the command for the time being....we would be open to a design proposal as to how to do this more maintainably...thanks!

from vscode-powershell.

andyleejordan avatar andyleejordan commented on June 26, 2024

Correction: on closer inspection it does look like all the stuff was migrated from that deprecated API, but it has all still been broken for quite a while (my guess is another VS Code change), at least a year as I tested v2023.1.0 to the same effect (opens a "view" but it's empty).

So unfortunately I think our decision stands. As it took a year (presumably, maybe a more recent VS Code update is what broke it) to come up that indicates its usage is too low for us to go about fixing. If someone wants to figure it out we'll be happy to take a PR. For now we're removing the code (which is also a massive simplification because it was the entirety of the "VSCode" module we had to build and ship with the extension).

from vscode-powershell.

SeeminglyScience avatar SeeminglyScience commented on June 26, 2024

Perhaps the community isn't aware of this feature at all? It is only mentioned in the 1.4.0 release notes and in an older issue about the possibility of adding css/js support. I stumbled upon this feature while doing some other research.

So I'm notorious for being the one person who was using X feature in a project and now it can't be cut. I was there when this was released, and I can tell you that the underlying API was so locked down that it was borderline useless and even I couldn't get anything useful working. It's one of those things that only really worked if you were shipping an extension with static files.

I'm sure some similar in theme commands could be made with the newer APIs but it'd be a completely different command shape so it becomes more of a feature request than a bug. I'd also personally say that it would likely be too much code to review and maintain even if it was graciously done as a PR by the community.

This is another scenario where it would be most ideal if we instead had a way for folks to make extensions that can interact with the PSES runspace in some way. That would let the community implement their own extension to provide that functionality. This is a long term plan of mine but it's not funded atm and my free time is a little short for the time being.

from vscode-powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.