You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing some issues when using the new in-line rename feature (in linked editing mode) from PR #1440. I appreciate the new feature very much, but there are cases where it does not work as expected.
Unexpected behavior that I observed so far (still testing):
Undo operations are in some cases split into very small steps (one letter at a time and each occurrence separately handled)
Take a method (e.g. in C/C++ editor from CDT LSP) that is used multiple times in the same file and press Alt + Shift + R to start the rename operation
Type a few letters, pause for 1 or 2 seconds, repeat twice
Try undoing the rename operation
Instead of undoing the three edits in three steps, the changes are undone letter by letter, while undoing the rename operation for each method name occurrence separately instead of changing all occurrences at once.
Selection doesn't fit to what was typed
In some cases, when renaming a method in multiple steps (similar to the case above), the caret jumps a few characters back and the rename selection changes to a substring of the new method name that I just entered. I did not yet find a way to reliable reproduce that.
Selection doesn't fit and undo makes wrong text edits
In some cases, renaming a method and then undoing the changes results in wrong text edits. At least, it seems, after undoing all changes, we get the original text version. Only intermediate results are corrupt.
Renaming a method and undoing it sends plenty textDocument/DocumentLink requests to the LS. That looks suspicious to me.
Video for case 1:
Undo-letter-by-letter.mp4
Video for case 3:
Undo-not-working-correctly.mp4
Video for case 4:
numerous-requests.mp4
It looks to me as if there is some concurrency issue in org.eclipse.lsp4e.operations.rename.LSPInlineRenameLinkedMode and related classes.
I've seen there is a preference for switching inline renaming off (what could be quick work-around to avoid the issues). Is there a reason why this switch is not presented in the UI (or did I just miss it)?
namespacecalculation {
staticdoublemult(double a, double b)
{
return a * b;
}
classAbstractCalculator
{
public:staticdoublemultiply(double a, double b);
staticdoubledivide(double a, double b);
doublesquareArea(double a, double b);
doublepercentage(double a, double b);
};
doubleAbstractCalculator::multiply(double a, double b) { returnmult(a, b); }
doubleAbstractCalculator::divide(double a, double b) { return a / b; }
classCalculatorImpl : publicAbstractCalculator
{
public:doublesquareArea(double a, double b)
{
returnAbstractCalculator::multiply(a, b);
}
doublepercentage(double a, double b)
{
returnAbstractCalculator::multiply(divide(a, b), 100);
}
};
}
I'm facing some issues when using the new in-line rename feature (in linked editing mode) from PR #1440. I appreciate the new feature very much, but there are cases where it does not work as expected.
Unexpected behavior that I observed so far (still testing):
textDocument/DocumentLinkrequests to the LS. That looks suspicious to me.Video for case 1:
Undo-letter-by-letter.mp4
Video for case 3:
Undo-not-working-correctly.mp4
Video for case 4:
numerous-requests.mp4
It looks to me as if there is some concurrency issue in
org.eclipse.lsp4e.operations.rename.LSPInlineRenameLinkedModeand related classes.I've seen there is a preference for switching inline renaming off (what could be quick work-around to avoid the issues). Is there a reason why this switch is not presented in the UI (or did I just miss it)?
@sebthom, could you please take a look at this?
Environment
C++ code used for testing: