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

[Question] findWithArgs searchString unable to use #4502

Open
1 of 2 tasks
xcoderYang opened this issue May 10, 2024 · 0 comments
Open
1 of 2 tasks

[Question] findWithArgs searchString unable to use #4502

xcoderYang opened this issue May 10, 2024 · 0 comments
Labels
feature-request Request for new features or functionality

Comments

@xcoderYang
Copy link

xcoderYang commented May 10, 2024

Context

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

Description

I try

editor.trigger(undefined, 'editor.actions.findWithArgs', {
  searchString: 'abc',
  replaceString: '',
  isRegex: false,
  preserveCase: true,
  findInSelection: false,
  matchWholeWord: true,
  isCaseSensitive: false,
});

// or

editor.trigger(undefined, 'editor.actions.findWithArgs', 'abc')

// or
editor.setSelection({
  startLineNumber: 2,
  startColumn: 2,
  endLineNumber: 3,
  endColumn: 3,
});
setTimeout(() => {
  editor.getAction('editor.actions.findWithArgs').run();
}, 1000);

I get
image

But i want
image

the same as https://stackoverflow.com/questions/78153430/react-monaco-editor-findwithargs

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.48.0#XQAAAAIsAgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0nhBcVciAKctgAboa7AaZZDHLgrLqPRv_fRv2RyIokydlTdTYccsu6v6jDrc8jQ8ulrCVzjWBVWZVl-YrARXWjHX0-tquUNesdygYRbQM1JUnAt3YmW0VSCWkY6ZkmLprhqNukEK_gFKBPwMtDrHypTK9MJxCpcT5NeztAM2FWUNPvskdfuQ0f51oo3cFTqHKAXgyhUK3zNO3cUIIl9SwAHijYFg9S0wxOoWEXGJDsJo2VubTorndRXmsPtjD5UDW0oGiZlza0AgEZiLRy0N6b-W_ltumVeCXd-_8goU6dSBdBM4s-WDGwjkq4UndKP4IY7QPUTIc49mmzAal1oienRouV1-_ViDT_KgMn1Q8AunzTaHKBMjgouKaHD6fnW6faNEHnQ5SkJYA_fo9Cs5602FdwN2fLyBnMo4bwb-r8fXDytioKDvkk-1hXdvGb4JXMEd_vaDIfA

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
}`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "javascript",
	automaticLayout: true,
});


myEditor.trigger(undefined, 'editor.actions.findWithArgs', {
  searchString: '123',
  isRegex: false,
  preserveCase: true,
  findInSelection: false,
  matchWholeWord: true,
  isCaseSensitive: true,
});
@xcoderYang xcoderYang added the feature-request Request for new features or functionality label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

1 participant