Find in Code Editor

Is the find command supported in the editor? I see it as one of the addon commands in CodeMirror. CodeMirror: User Manual

Hey there!

Our curriculum uses the Monaco editor, not CodeMirror. It does look like the find UI is disabled, though.

1 Like

Not exactly the same as search but anyway:

If you select the identifier (what you are looking for) and press Crtl + F it should highlight all the occurrences (You can also use F1 and type the command).

If you want to replace all occurrences you can select the identifier and press Ctrl + Shift + L.

@lasjorg Thanks, that is nice to know but I’m usually trying to quickly find what the instructions are referring to such as find the text “X” and replace it with “Y”.

I did find you can access the command Palette with a right click. The “Go To Symbol” command still works but that only works for symbols and not for random text.

If you select the challenge text (or just give that frame focus) and press Ctrl + F it will use the browser find which will also search inside the code editor.

1 Like

Ah thanks, that works! I was trying to Ctrl+F in the editor where it’s disabled.

Sadly Ctrl + F will not find the text if it’s too far off screen in the code editor. I’m guessing for performance reasons the editor only loads a portion of the text until you scroll, because of that the browser search won’t find it.

There is a bunch of stuff disabled in the fCC editor that you would normally have in your code editor. It is just a choice made to force a more hands-on approach. It might be helpful for beginners but it can be quite annoying for more experienced users that are used to having the tools available.

If you want the full editor experience I’d suggest copying the code into VS Code. For JS something like the Quokka extension is also very handy.