microsoft / microsoft/monaco-editor
[Question] findWithArgs searchString unable to use
Open
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
But i want
the same as https://stackoverflow.com/questions/78153430/react-monaco-editor-findwithargs
Monaco Editor Playground Link
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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