Menu

#54 Support for search and replace function

1.13
accepted
nobody
None
Feature
5
2020-01-21
2018-01-08
Mattes H.
No

Many times this was discussed here and in other rounds.
Starting with the milestone 1.12 I will mostlikely focus on S&R feature.
Requests like https://sourceforge.net/p/analyseplugin/discussion/1662529/thread/0c6dc257/
have been put requesting this.

Discussion

  • Mattes H.

    Mattes H. - 2019-01-03

    Hi All,
    while thinking about S&R feature I thought it's probably a good idea to get your feedback on a concerned question comnig up on this.

    Let's assume you want to have sevral patterns being replaced and more or less the second pattern catches the same line / same text in the original text as the first and replaces some overlapping text. What would be the expected behavior?

    1. show a combination of S&R of pattern 1 and 2
    2. show the results of this line with the S&R action of pattern 2
    3. show a result which have stacked both S&R actions (i.e. pattern 2 was executed on the modified text of pattern 1)
    4. any other behavior...

    All this choices have consequences and I'm uncertain which would th ethe one I should try out.

    Here my initial opinions:
    for 1.) I'm very much in favor or deterministic behavior and this rises to be magic if I would try to make any "intelegent" combination of S&R results. It would be a nightmare for people to write and trial n. error until the expected result becomes visible.

    for 2.) this seems to be very consistent to current behavior of coloring in the text, however, it has the side effect, that the S&R of pattern 1 may look as omitted although the search pattern would still hold good. Anyway this is the way which is currently in favor.

    for 3.) this looks like being very attractive in the first view as it would be kind of a "batch replacement". But this would have two quite bad side effects. a) assuming the result of the text does not look like wanted. How to find out which of the "intermediate steps did propably fail?
    b) also it would mean that I have to hold several copies of the complete text for the intermediate S&R steps as the scope of the always next pattern again has to be applied to the complete "new" text. Hence, this behavior is probably not a good choice, but waiting for your comments and arguments.

    for 4.) Any algorithmic description of how to apply multiple S&R actions is welcome and may help to bring me forward with my thoughts.

    Please, comment!

     
  • Mattes H.

    Mattes H. - 2020-01-21
    • Group: 1.12-preview --> 1.13
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB