I have implemented references between wiki links in the MultiMarkdown plugin and the file that they are refering to.
I can rename the file and all the links refering to it get renamed. Awesome.
I can also do rename on the link and the file rename dialog opens.
1. However, if the file name contains dashes (which in the link become spaces) or other non-identifier characters, the link still refers to the correct file, I traced it and can do rename refactoring on the link and the file rename dialog opens, but when the file is renamed its refering links do not get renamed.
Something seems to filter references based on the text they contain because I traced the code as far as I could in the action and the usageInfo is empty if the links have non-standard characters but the links still return references that resolve to the correct PsiFile as witnessed by rename on the link opening the file rename dialog.
2. Additionally, two links refering to the same file will not get wordhighlighted when the caret is on one of them if the link has a space but will highlight if the link has no spaces. They will highlight if the link has non-standard identifier characters like @.
3. Not refactoring but completions, work fine for spaces or no spaces but if the link has non-standard chars @ then hitting tab on a completion replaces text only to the @ and not the full node's text. This too requires to override, implement something to allow replacing of the whole text of the element.
I implemented a Manipulator, NamesValidator, UsagesProvider, RefactoringSupportProvider, ReferenceContributor, CompletionContributor.
What extensions/interfaces/listeners do I need to implement so that I can override the behaviour in these 3 cases. It seems they have similar but not identical causes so I am assuming I will need to address them separately.
I have spent two days reading code, posts, searching the docs and got it working to this point but I did not find anything that deals with non-standard identifier refactoring or code completion.
Any pointer in the right direction will be greatly appreciated.