IDE Search & Replace

ctrl-F brings up a search bar in the IDE inviting me to use regex.

I want to do a global search & replace but cannot get the correct syntax. My regex is patchy at best but this is what I’ve tried :

/self.style/self._style/g
s/self.style/self._style/g
/self\.style/self\._style/g
s/self\.style/self\._style/g

Can’t think of any others.

Please can you advise? Is it a particular style of regex that i can google?

4 Likes

Somewhat related, but I posted a message here 18 days ago requesting a list of all the hot keys, such as Ctrl-F, that are available in the IDE, but Anvil has not yet responded. Ian? Meredydd?

1 Like

Ian, Meredyyd? Still awaiting a response.

Happy new year everyone!

Did anyone got a solution to do a find-replace on the IDE code yet? For example, lets say one changed the name of an object from button_1 to button_start and now needs modified the code accordingly. Thanks

1 Like

It’s been a while :wink: Meredydd?

2 Likes

Currently, there is no search and replace in the Editor. Moving to Feature Requests.

The usual factors apply in what we prioritise:

If people reply to this thread saying they’d like this, it will be more of a priority.

We will make a priority of features that are requested by somebody on a support contract - contact us on support@anvil.works if you wish to discuss further.

You can also sponsor the implementing of a specific feature - again, contact us on support@anvil.works to discuss further.

1 Like

This feels like a critical feature for a code editor, no? As a (so far) freeloader, I am only grateful, but just adding my two cents.

2 Likes

I agree, search and replace would be nice. Anvil does an excellent job of updating the hooks in the visual portions of the IDE when you change component names, but a search and replace would make converting the code references easier.

1 Like

This appears to be implemented. Ctrl-G. Also, now Ctrl-Shift-F searches the whole app.

1 Like

Where you able to use Ctrl+G?

In the Code View. Link: https://anvil.works/docs/editor/keyboard-shortcuts

Thanks. I dug a little and found out that there is some confusion. I think this should be a bug report.

Press Ctrl+F on the IDE and it says you can replace with Ctrl+G:
image

The documentation says it’s Ctrl+H:
image

You try and find out that it’s Ctrl+Shift+H.

:anguished:

Agreed. One for the :beetle: reports.

You’re completely right about the confusion - in fact all these were fixed in an update today that will go live in the next few days :slight_smile:

3 Likes

Hi Ian,

You might also fix some spelling errors: I noticed that in https://anvil.works/docs/editor/keyboard-shortcuts there are a few occurrEnces of occurAnces.

This confusion has now been cleared up. Thanks for your patience!