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

Add powershell completer (#8939) #10424

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

ShaunLawrie
Copy link

What does this PR do?

This adds completions for PowerShell. It should work back to PowerShell v5 and cross platform.
Rather than add hard coded completions it pulls available args from the bun help.

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

Built and installed on Windows for now, the idea needs fleshing out which is why this is a draft.

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
  • I included a test for the new code, or an existing test covers it
  • JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed
  • I wrote TypeScript/JavaScript tests and they pass locally (bun-debug test test-file-name.test)

// log("GetBinaryTypeW({}) = {d}. isExecutable={}", .{ bun.fmt.utf16(path), out, result });

// return result;
const stringPath = bun.String.createFromOSPath(path);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my first time writing zig. This works but I'm sure there's a better way to do this. Windows 16bit-ish paths that couldn't be squished to utf8 would not match any executable extensions.
image

@ShaunLawrie
Copy link
Author

Also for duplicate issue #10293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant