Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 412817

Summary: [rename][linked mode][content assist] Content assist during rename shows too many proposals if invoked where the variable is used
Product: [Eclipse Project] JDT Reporter: Timo Kinnunen <timo.kinnunen>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert, timo.kinnunen
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description Timo Kinnunen CLA 2013-07-11 21:36:45 EDT
Consider these settings:

Java->Refactoring Java code, Rename in editor without dialog: yes
Java->Editor->Content Assist->Auto Activation, Enable auto activation: yes
Java->Editor->Content Assist->Auto Activation, Auto activation triggers for Java: .ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

Now, press Alt-Shift-R to activate inline rename refactoring and start changing a name: auto activation triggers content assist, but due to content assist and rename mode not being aware of each other the suggestions that are displayed are not appropriate in this context. This is inconsistent with Rename dialog which doesn't have content assist enabled.
Comment 1 Timo Kinnunen CLA 2013-07-11 21:47:14 EDT
Bug 411414 could provide the detection code for when to suppress content assist.
Comment 2 Dani Megert CLA 2013-07-15 08:10:39 EDT
I cannot reproduce this using R4.3 [1]. Please reopen with more detailed steps if you see this in R4.3 or newer.

[1] http://download.eclipse.org/eclipse/downloads/drops4/R-4.3-201306052000/
Comment 3 Timo Kinnunen CLA 2013-07-15 12:35:07 EDT
Reproduced in Eclipse SDK Version: 4.3.0 Build id: I20130605-2000 with the steps from description and using this code and these additional steps:

	private void instanceMethod(String manager) {
		String helper = "";
		System.out.println(manager + " and " + |helper); // start rename with cursor at |
	}

Start rename with cursor at the start of a variable name that's being passed to another function. Pressing 'a' displays a proposal list of classes starting from AbstractMethodError. Pressing backspace to erase the 'a' displays a list of all locals, fields and classes visible in scope.
Comment 4 Dani Megert CLA 2013-07-16 04:41:31 EDT
OK, I see. This has nothing to do with auto activation. The same happens if you simply invoke content assist inside the linked mode.

It works if the identifier is changed where it is declared, but not where it is used.
Comment 5 Timo Kinnunen CLA 2013-07-16 07:01:36 EDT
Hmm, to me this seemed like an unintended interaction under very particular circumstances that should be prevented from happening and thus a change to Auto Activation, but that works for me as well.
Comment 6 Eclipse Genie CLA 2019-11-10 15:38:26 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.