-
Notifications
You must be signed in to change notification settings - Fork 174
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
[Feature Request]: PowerShell support #69
Comments
Can the powershell adapter open a TCP port for the DAP channel? If so, vimspector can talk to it the same way it does the java adapter. #3 |
Oh one more thing - vimspector (almost certainly) doesn't work on Windows. |
Sadly no, we've found it to be a bit too insecure for our liking... We could have secured it... But Named Pipes made more sense considering PSES is on the same file system as the client and they're easy to secure.
That's ok, PowerShell works cross-platform 😎 I want to use this on my mac. |
It seems like we need to do something similar to Java. As a stopgap we can use the bridge. Essentially, PSES writes a tiny json file with the name of the pipe we need to connect to. The path to the session file might be hard to find, but that can be manual for now like the Java experience. |
TIL. Thanks.
I guess we're limited to what vim's channels support. I haven't attempted to open a domain socket using It might just work if you use an adapter config like the java one: {
"adapters": { "PowerShell": { "port": "ask" } },
"configurations": { "launch": { "adapter": "PowerShell", "configuration": { ... } }
} Then when asked for the port, pass the path to the socket. I haven't tried this. |
OK well I tried it and it doesn't work. Doesn't look like
|
Well there's always a hack around....
But it just crashed...
|
Vimspector session including messages:
|
With verbose output:
|
Can you share with me how you started PSES? |
@TylerLeonhardt sure thing. I used the following 2 scripts:
And the following {
"configurations": {
"launch": {
"adapter": "PowerShell",
"configuration": {
"request": "launch",
"Script": "${file}",
"NoDebug": false,
"StopOnEntry": true,
"Args": [],
"Cwd": "${workspaceRoot}",
"CreateTemporaryIntegratedConsole": true,
"Env": {}
}
}
}
}
And the following modification to diff --git a/install_gadget.py b/install_gadget.py
index 6da3b35..8248559 100755
--- a/install_gadget.py
+++ b/install_gadget.py
@@ -128,7 +128,8 @@ GADGETS = {
},
'macos': {
'file_name': 'netcoredbg-osx-master.tar.gz',
- 'checksum': '',
+ 'checksum':
+ '775c588b0b9acd86318d0c9e8a4af37f74e0bafb8d0564df410f687872d6f7d3',
},
'linux': {
'file_name': 'netcoredbg-linux-master.tar.gz',
@@ -260,6 +261,32 @@ GADGETS = {
},
},
},
+ 'PowerShellEditorServices': {
+ 'language': 'powershell',
+ 'enabled': False,
+ 'download': {
+ 'url': 'https://github.com/PowerShell/PowerShellEditorServices/releases/'
+ 'download/v${version}/PowerShellEditorServices.zip',
+ 'format': 'zip',
+ },
+ 'do': ( lambda name, root:
+ MakeSymlink( gadget_dir,
+ name,
+ os.path.join( root, 'PowerShellEditorServices' ) ) ),
+ 'all': {
+ 'version': '1.13.0',
+ 'file_name': 'PowerShellEditorServices.zip',
+ 'checksum':
+ 'd10bda5c7d36795bb8f860b2d09a637f8f98ee401c60ac4c40a636f8606565b9'
+ },
+ 'adapters': {
+ 'PowerShell': {
+ 'name': 'PowerShell',
+ 'type': 'PowerShell',
+ 'port': 'ask',
+ },
+ },
+ }
}
@@ -453,7 +480,8 @@ class ModePreservingZipFile( zipfile.ZipFile ):
ret_val = self._extract_member( member, path, pwd )
attr = member.external_attr >> 16
- os.chmod( ret_val, attr )
+ if attr:
+ os.chmod( ret_val, attr )
return ret_val
|
Ah! That's with the LSP mode on as well (default behavior). Can you try with adding the |
When I add that I get this:
Without the flag it doesn't print that. |
Doeesn't work due to debugger crashing on stack trace request. Related #69
pushed the changes with the files in case you want to try it. |
You know what, I think the latest release is kinda broken for "debug only" on non-Windows. We're doing a preview release on Monday with all of that fixed. I can give this a go. I'm currently on vacation, but I promise as soon as I get back I'll be more helpful 😅 Thanks for all your interest so far, I am excited to set this all up! |
@puremourning hi! Finally got around to trying this... I'm having trouble getting vimspector working...
I have python3 installed... perhaps I'm missing something? |
Your vim has to be compiled with python 3 support. |
How to do that? (sorry, pretty new to this "suff") EditDebian provides VIm with Python3 support as |
https://github.com/puremourning/vimspector/wiki/languages I'm unlikely to add further niche languages as core features. Rather community-maintained plugin files above. |
Describe the solution you'd like
This is the issue to discuss what we need to do to support PowerShell Editor Services PowerShell's language server and debug adapter.
Additional context
PowerShell Editor Services uses Named Pipes/unix domain sockets for the communication layer. This is because we typically have the LSP and DAP being used at the same time.
In vscode, we bridge stdio to the named pipes using this TypeScript file which acts as the "entry point" or "executable" for vscode.
I think we can leverage this as well for vimspector.
My ideal situation is to start PowerShell Editor Services up with either coc-powershell or YCM (which I'd love guidance on :)) and then connect to that using vimspector.
What do you think? 😄
The text was updated successfully, but these errors were encountered: