Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare rename breaks if you have edited the symbol just before the call. #1483

Closed
yyoncho opened this issue Jun 16, 2020 · 2 comments · Fixed by #1491
Closed

Prepare rename breaks if you have edited the symbol just before the call. #1483

yyoncho opened this issue Jun 16, 2020 · 2 comments · Fixed by #1491
Assignees
Labels

Comments

@yyoncho
Copy link
Contributor

yyoncho commented Jun 16, 2020

First, I started getting this error when using Extract Field refactoring. Apparently, Emacs is much faster than vscode for the rename call which causes the prepare rename failure.

Then I was able to reproduce it manually in vscode by pressing very fast Backspace + F2 when the cursor is placed on a field. Note that you might need a bit more complex project to trigger the behaviour(I was using one generated from spring initializr, I can provide one but it should be relatively easy to reproduce the issue).

Error log:


[Trace - 10:35:50 PM] Sending request 'textDocument/prepareRename - (26)'.
Params: {
  "textDocument": {
    "uri": "file:///home/kyoncho/Sources/emacs-spring-demo/src/main/java/com/emacs/demo/emacsspringdemo/DemoApplication.java"
  },
  "position": {
    "line": 8,
    "character": 19
  }
}


[Trace - 10:35:50 PM] Received notification 'window/logMessage'.
Params: {
  "message": "Jun 16, 2020, 10:35:50 PM >> document/prepareRename",
  "type": 3
}


[Trace - 10:35:50 PM] Received notification 'window/logMessage'.
Params: {
  "message": "Jun 16, 2020, 10:35:50 PM ss {key=Lcom/emacs/demo/emacsspringdemo/DemoApplication;.ss)Ljava/lang/String;} [in DemoApplication [in [Working copy] DemoApplication.java [in com.emacs.demo.emacsspringdemo [in src/main/java [in emacs-spring-demo]]]]] does not exist\nss {key=Lcom/emacs/demo/emacsspringdemo/DemoApplication;.ss)Ljava/lang/String;} [in DemoApplication [in [Working copy] DemoApplication.java [in com.emacs.demo.emacsspringdemo [in src/main/java [in emacs-spring-demo]]]]] does not exist\nJava Model Exception: Java Model Status [ss {key=Lcom/emacs/demo/emacsspringdemo/DemoApplication;.ss)Ljava/lang/String;} [in DemoApplication [in [Working copy] DemoApplication.java [in com.emacs.demo.emacsspringdemo [in src/main/java [in emacs-spring-demo]]]]] does not exist]\n\tat org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:573)\n\tat org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:614)\n\tat org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:326)\n\tat org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:312)\n\tat org.eclipse.jdt.internal.core.Member.getFlags(Member.java:172)\n\tat org.eclipse.jdt.ls.core.internal.corext.refactoring.RefactoringAvailabilityTester.isRenameElementAvailable(RefactoringAvailabilityTester.java:1376)\n\tat org.eclipse.jdt.ls.core.internal.handlers.PrepareRenameHandler.isBinaryOrPackage(PrepareRenameHandler.java:85)\n\tat org.eclipse.jdt.ls.core.internal.handlers.PrepareRenameHandler.prepareRename(PrepareRenameHandler.java:64)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$20(JDTLanguageServer.java:688)\n\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:74)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)\n\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)\n",
  "type": 1
}

@snjeza
Copy link
Contributor

snjeza commented Jun 23, 2020

@snjeza snjeza self-assigned this Jun 23, 2020
@yyoncho
Copy link
Contributor Author

yyoncho commented Jun 24, 2020

@snjeza I tried that build and it seems to be working fine.

@fbricon fbricon added the bug label Jun 25, 2020
@fbricon fbricon added this to the End June 2020 milestone Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants