monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Feature Request] Close peek problem/definition window programmatically

Open NGPixel opened this issue 1 year ago • 2 comments

Context

  • [X] This issue is not a bug report. (please use a different template for reporting a bug)
  • [X] This issue is not a duplicate of an existing issue. (please use the search to find existing issues)

Description

When setting markers on a model and then calling editor.action.marker.next to open the peek window on the first marker, there's no way to close it other than the user clicking the X button or pressing Escape.

I'd like to be able to close the peek window via the API so that it can automatically be closed on certain events (e.g. once the model changes).

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

NGPixel avatar Mar 01 '24 06:03 NGPixel

Hey , any update or a workaround for this???

sameemqiitm avatar Sep 03 '24 11:09 sameemqiitm

I've used successfully for a while:

editor.trigger('', 'closeMarkersNavigation', {});

The trigger above always focuses the editor, though, which may be undesirable in some cases. Now I'm using:

editor.getContribution('editor.contrib.markerController').close(false);

Source in VSCode repo

lucach avatar Mar 24 '25 14:03 lucach