Skip to content

Commit

Permalink
Disable LSP rename handler for Java file
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Feb 28, 2023
1 parent 0584590 commit 7087ee3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion org.eclipse.lsp4e/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,24 @@
class="org.eclipse.lsp4e.operations.rename.LSPRenameHandler"
commandId="org.eclipse.ui.edit.rename">
<activeWhen>
<reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" />
<and>
<!-- LSP rename handler is active when: -->
<!-- 1. The file is not a Java file to avoid conlict with JDT UI rename handler -->
<not>
<with variable="editorInput">
<or>
<adapt type="org.eclipse.core.resources.IFile">
<test property="org.eclipse.core.resources.contentTypeId" value="org.eclipse.jdt.core.javaSource" />
</adapt>
<adapt type="org.eclipse.jdt.core.IClassFile">
<instanceof value="org.eclipse.jdt.core.IClassFile" />
</adapt>
</or>
</with>
</not>
<!-- 2. The file is mapped with a language server -->
<reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" />
</and>
</activeWhen>
</handler>
<handler
Expand Down

0 comments on commit 7087ee3

Please sign in to comment.