Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add notifyOnAttach option #5249

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

Draft
jborean93 wants to merge 1 commit into PowerShell:main
base: main
Choose a base branch
Loading
from jborean93:attach-notify

Conversation

Copy link
Contributor

@jborean93 jborean93 commented Jul 28, 2025

PR Summary

Adds the new notifyOnAttach option for an attach request. This option will have PSES create a new event with the source identifier PSES.Attached that allows the attached script to wait for the attach event.

Should wait until PowerShell/PowerShellEditorServices#2250 is merged (or rejected).

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • [NA] PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

Copy link
Collaborator

Is the explicit option super necessary or is this something we can auto-detect? Like the combination of the options attach and script

Copy link
Contributor Author

It is not strictly necessary as you can put whatever values you want in the launch.json configuration and it'll just pass through to PSES. But these values are used for auto completion and provides hints in VSCode when you start writing the JSON configuration in launch.json. It'll also appear as yellow if you use an option not defined in the package.json so it would appear as invalid.

AFAIK there is no other way to define it, this must be statically defined and cannot be done at runtime.

Copy link
Collaborator

@jborean93 sorry, yes I am aware, this comment should have been on the actual implementation in PSES, sorry.

Copy link
Contributor Author

I'm not sure if PSES could do it dynamically. Maybe a source generator to generate the record from the package.json but IIRC source generators don't like IO work but I could be misremembering.

Copy link
Collaborator

JustinGrote commented Jul 29, 2025
edited
Loading

@jborean93 this PR is fine, my point was I was wondering if we could do away with the setting altogether in PSES and instead detect when the notify is needed based on the other launch options. If not that's totally fine, having it as a manual specification is not a problem, just thinking about user ergonomics.

EDIT: And that can always come as a later optimization PR.

Adds the new `notifyOnAttach` option for an attach request. This option
will have PSES create a new event with the source identifier
`PSES.Attached` that allows the attached script to wait for the attach
event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

Copilot code review Copilot Awaiting requested review from Copilot Copilot will automatically review once the pull request is marked ready for review

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /