Skip to content

Commit

Permalink
Fix @rename to also affect display name
Browse files Browse the repository at this point in the history
  • Loading branch information
jtackaberry committed Oct 24, 2021
1 parent 135175b commit 45a2cea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,14 @@ def _set_name(self):
self._name = default_scope_name
display = display or self._name
else:
if rename:
self.symbol = rename
self._name = self.symbol

if rename:
if '.' in rename:
self.symbol = rename
else:
self.symbol = ''.join(re.split(r'([.:])', self.symbol)[:-1]) + rename

if not display:
if '.' not in self.symbol and ':' not in self.symbol and scope != '.':
display = (scope or default_scope_name) + '.' + self.symbol
Expand Down

0 comments on commit 45a2cea

Please sign in to comment.