Skip to content

Feature: Add rawtext flag to Mapping #12

@MartinWitt

Description

@MartinWitt

Currently for regex replacements the user needs to escape the string.
e.g.

	mapping = {
		from = "adapterFactory.dispose\\(\\);"
		to = "\\(\\(IDisposable\\) \\(adapterFactory\\)\\).dispose\\(\\);"
	}

This leads to easy faults and mistakes. A raw text flag could reduce the visual clutter. A solution to reduce this could be either Pattern.quote() or in the future a use of java 14 RawTextLiterals. Adding a flag in e.g. Mapping``boolean rawtext = false with default value false would keep the behavior of existing configs the same, but allows newer configs to profit from this change. A config entry with the new flag could like this. Increased readability and more fault tolerant.

	mapping = {
                rawText = true
		from = "adapterFactory.dispose();"
		to = "((IDisposable) (adapterFactory)).dispose();"
	}

wdyt about this improvement?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions