Community
Participate
Working Groups
when doing refactoring in i.e. intellij it will take into account the "context". i.e. trying to extract a method for "Catalog catalog = getMergedCatalog(cwd, false);" intellij will offer to call the method "getCatalog" while eclipse calls it "extracted". This applies to almost all refactorings afaics.
Seems like a relatively easy fix. @Roland: does JDT-LS reuse the default proposals from JDT here? If we change that part of JDT, would JDT-LS automatically have access to this enhancement?
This rang a bell, and I managed to find https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/162579 , where we did something similar. This is all in org.eclipse.jdt.core.NamingConventions#suggest* . I think for blocks of text there could be some heuristic where the suggestions are based off the last declared variable that is not being referenced in the selected range. The extract method refactoring is copied over into jdt-ls because it's currently sitting under jdt.ui (and not under core.manipulation).