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

Support multiline replace #70

Open
icco opened this issue Jul 15, 2021 · 1 comment
Open

Support multiline replace #70

icco opened this issue Jul 15, 2021 · 1 comment

Comments

@icco
Copy link

icco commented Jul 15, 2021

I have the following in a lot of files:

          Log.send(
                new LogData(
                    this.baseData,
                    `${this.tryGetPingMatterLinkedToUser.name}.ts`,
                    userId,
                    Level.Warn,
                    `Dms client matter code: ${filedDocument.DmsClientMatterCode()} does not exist in Ping`
                )
            );

I want to replace all with logger.error(error).

I tried lots of different things, but I expected ruplacer 'Log\.send\((?s:.)*\);' 'logger.error(error)' -t ts to work, but it does not. Any thoughts?

@ErichDonGubler
Copy link

Adding some context here: Current behavior's limitation to single-line changes is because ruplacer's logic is very baked against processing individual lines at the moment. For reference in main ATOW, see:

I don't see a technical reason that ruplacer couldn't do multi-line edits, but it would involve some major shifts to ruplacer's UX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants