Community
Participate
Working Groups
Grammar: Model: greetings+=Greeting*; Greeting: 'Hello' name=ID '!' other=[Greeting]?; File1: Hello Greeting1! Greeting1 File2: Hello Greeting2! Greeting1 Try to rename Greeting1 in File1 to Greeting2. You'll get a dialog with: [ A fatal error occurred while performing the refactoring. Found problems: Error during refactoring: null argument. See log for details. No context information available. ] The error log does not contain any entries. Nothing in the log of the host-eclipse, too.
Issue continued in bug 356342. *** This bug has been marked as a duplicate of bug 356342 ***
Not a duplicate, but a dependency.
The problem here is that we have no strategy to check uniqueness of names cross resource boundries (see bug 327863). When updating a cross reference to a renamed element, the cross reference serializer (CRS) is asked for the replacement text. If the renamed element is shadowed, this text is null, as the scope implementation filters it silently. From a user point of view, I'd expect an rename status warning in this case (as in JDT a "possible conflict"), but the refactoring should be forceable if I know what I am doing. As the filtering of shadowed elements is internal to the scope implementation, there is no way to access the filtered elements from the outside. That's a pity, as it gets almost impossible to get the link text for the "force" case described above. I see two options 1) Report a fatal error in the case the CrossRefSerializer returns null. Refactoring cannot be performed then, so there is no "force anyway" option. 2) Don't use the CrossRefSerializer to calculate the replace text but our own component with a fallback strategy: If the element cannot be found in the scope, report a warning and look it up in the parent scope recursively. The disadvantage is that a customized CRSs will be ignored. BTW, the Xtext grammar language has a customized CRS...
Added a hook to resolve name conflicts in bug 345589. Error dialog now show critical location.
Pushed to MASTER
Closing all bugs that were set to RESOLVED before Neon.0