Skip to content

Conversation

@colin-grant-work
Copy link
Contributor

What it does

Fixes #11059 by fixing the MonacoContextMenuService to call onHide. Previously, it was returning the callback rather than calling the callback, resulting in this flag never getting reset, pushing us down this code path, resulting in the immediate disposal of any contributed code action items.

How to test

  1. With this extension: code-action-demo-0.0.1.zip (source).
  2. Open a plain text file.
  3. Select any span of text.
  4. A code action lightbulb should appear.
  5. Click the lightbulb or hit CtrlCmd+.
  6. Execute the test code action.
  7. You should see a toast indicating that the code action was executed with the argument 'test'.
  8. Repeat 3-7, and you should still be able to execute the code action successfully.

  1. Checkout this branch
  2. Run the API tests (yarn browser test)
  3. They should pass.

The test on that branch doesn't work with the version of the TypeScript plugin we currently use - the code actions contributed by TS have a bug - so that branch is rebased on #11083 and uses [email protected]. I will make a separate PR for the test that can be merged once this PR and #11083 have been merged.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added monaco issues related to monaco menus issues related to the menu labels May 12, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes work well for me 👍

@colin-grant-work colin-grant-work merged commit 26b7891 into eclipse-theia:master May 13, 2022
@colin-grant-work colin-grant-work deleted the bugfix/code-actions-with-arguments branch May 13, 2022 17:08
@colin-grant-work colin-grant-work added this to the 1.26.0 milestone May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

menus issues related to the menu monaco issues related to monaco

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code action command with arguments parameter execute fail

2 participants