Before anything like this could be implemented we need to consider all the design details to determine how much work it'd be or if it's even possible given the current system.
Sure, we could minimize the number of comments we need to scan by only looking through comments that have a ReplyTo UserId set, which would roughly be comments that landed in that user's inbox, or at least the ones that matter. That might exclude some comments where the name does appear, just misspelled, but there's no way we could possibly match situations like that anyways. It would also exclude comments on your own posts (which always notify you) that stripped the @-mention but the user incorporated it into the comment in some other way.
It might sound easy to just match the @ part of that list of comments at the beginning and look for your name, but there are other considerations that make this much more difficult:
- The @-mention does not always appear at the beginning of a comment. It can be at the end or nested in the middle of a comment. We'd have to search the entire comment for any matches to the @ pattern.
- The full display name is not required in order to trigger a notification to a user. You can trigger a notification with as few as three characters, so only searching for the full display name may not yield results that could still be identifying of your previous name.
- This opens another typo avenue. In the case of John Smith, someone could type "@john smith" and the "@john" would still notify the user but the "smith" part would not be part of the mention and would not be recognized by any part of such a mechanism we could implement.
- You could possibly alleviate this by only searching for @ with the first three letters of the display name and assuming that it would be yours, but I'm sure there are some cases where that's nor true and would break things. The fewer characters you are matching against, the more likely you are to run across actual words, acronyms, or other things that are legitimately used in programming. Which brings me to:
- Searching for mentions would inevitably require parsing the entire comment first in order to determine the context of the @text, which might appear in code and should not be replaced if matched. As well, the @ characters itself is used in some programming languages, email address, and many other contexts.
I'm sure there are many other considerations for implementing something like this, and we've already dug ourselves a pretty deep hole we would never get out of. Many of these considerations are why we have never attempted to build something like this and even opted to exclude the text of comments from GDPR requests entirely. There is just no good way of doing this automatically.
That's not to say there never will be. Teams has a more direct linking feature that completely re-imagines mentions to allow for direct linking to the user's profile and multiple mentions per post. Because the @-mention is not a part of the comment but a separate entry looking up the user, display name changes would be automatic as well. I am not aware of any plans to ever bring that feature to the public sites, but that is the kind of complete rewrite of the system that would be needed to truly resolve these issues (obviously it wouldn't be applied retroactively, and there's little to no hope of fixing this for past comments). Hacky, text-based alternatives are sure to cause problems and break.