Comments (12)
@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.
@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.
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.
@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.
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.
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.
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.
Info I found on its removal/deprecation: microsoft/vscode#62630
from vscode-powershell.
It looks like Tyler got the CustomViews
migrated to the new API but the ContentView
stuff was missed: #1602
from vscode-powershell.
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.
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.
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)
- The use of "-" in snippet prefixes should be prohibited. HOT 9
- PssaCmdletAnalysisEngine fails with "Errors found while formatting file" and no additional data HOT 4
- Some variables are not highlighted (`$Error`, `$PSVersionTable`) HOT 1
- Incorrect indentation when passing a hashtable as a function argument HOT 3
- Extension do not work HOT 2
- Recalling a previous command via PSReadLine in VScode is unusable is the prompt contains U+231B in the CaskaydiaCove NF font HOT 3
- PowersShell Installation version issue
- Azure Repos Virtual Filesystem: Intellisense stops working on branches other than "main". Only returns "no suggestions". Works fine on "main" branch. HOT 6
- VS Code with PowerShell extension fails to assig a value to a variable HOT 2
- Debug string [DBG] not displayed in the terminal HOT 19
- Powershell Extension never starts. Terminal Message: "Starting server, deregistering host logger and registering shutdown listener" HOT 11
- Launching VSCode Also Opens cmd.exe Console Behind VSCode HOT 3
- Intellisense not working for properties of the same type as the class HOT 2
- v2024.2.0 No longer loads my Pwsh profile in the integrated terminal. How can I fix this? HOT 7
- v2024.2.0: PowerShell Terminal Fails to Load Due to PSES change to non-Windows-trusted Certificate HOT 36
- If Connecting to MSGraph then connecting to ExchangeOnline, error OperationStopped: Could not load file or assembly 'Microsoft.Identity.Client, Version=4.44.0.0. HOT 3
- vscode theme/colors breaks when i open each new tab/extention page HOT 3
- VSCode "restart extensions" on any extension update makes vscode-powershell start a new terminal HOT 5
- Function Parameters in a Class Module Do Not Show in Intellisense/Autocompletion HOT 6
- Language Server Becomes Unresponsive After Opening Command Explorer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-powershell.