Commit c3133ad
committed
fix rename to replace only the referenced identifier in paths
When renaming Bar in Foo::Bar, the entire path was being replaced
with just the new name instead of producing Foo::Baz.
Added PathView::last_segment_span() to get only the identifier span
of the last segment. Added ReferenceView::rename_span() that delegates
to last_segment_span for paths while returning normal spans for other
reference types. Updated rename handler to use rename_span() instead
of span() for text edits.
This preserves goto-definition behavior (which needs full path spans
to detect intermediate segment clicks) while fixing rename to only
replace the actual referenced item.1 parent 971e8d9 commit c3133ad
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments