microsoft / microsoft/monaco-editor

[Question] findWithArgs searchString unable to use

Open
#4,502 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

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,
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Monaco Editor Playground and the editor.actions.findWithArgs entry point. Reproduce the reported behavior using the supplied arguments and compare it with the expected find result shown in the issue. Done means determining whether the API is misbehaving or whether its supported usage and documentation need clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.