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

Bug 144866

Summary: [assist][javadoc] Wrong completion inside @value tag
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.2   
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Frederic Fusier CLA 2006-06-01 07:50:18 EDT
Using 3.2 RC6 but should exist since the first javadoc code assist JDT/Core implementation...

If I complete inside an inline @value tag, then complete tag template is always proposed instead of the reference.

Example:
public class X {
  public static int EXAMPLE = 0;
  /**
   * This method uses {@value EX|} when
   * implementation will be finished...
   */
  public void foo() {
  }
}

Completion at <|> position will give following proposals:
{@link EXAMPLE}
{@value EXAMPLE}

Although we should have only:
EXAMPLE

Note that it works well with @link inline tag...
Comment 1 Frederic Fusier CLA 2006-06-02 07:20:34 EDT
Note that example was not correct, it should be instead:
public class X {
  public static int EXAMPLE = 0;
  /**
   * This method uses {@value #EX|} when
   * implementation will be finished...
   */
  public void foo() {
  }
}

Note also that 1.4 compliance is needed to see the problem. Completion proposal is correct with 1.5 compliance...

@value inline tag accepts a reference only since 1.5. That's why javadoc completion wrongly assumes that user was completing in text and propose the entire inline tag.
Comment 2 Frederic Fusier CLA 2006-06-02 09:18:10 EDT
Created attachment 43346 [details]
Proposed patch

Fix is really simple: do not set CompletionOnJavadoc.TEXT bit to completionNode flag when inline tag has started...
Comment 3 Frederic Fusier CLA 2006-06-02 09:22:12 EDT
Patch released in TARGET_321 stream
Comment 4 Frederic Fusier CLA 2006-06-12 06:16:44 EDT
Released for 3.2.1
Released for 3.3 M1 while merging TARGET_321 in HEAD
Comment 5 Frederic Fusier CLA 2006-08-04 12:13:13 EDT
Verified for 3.3 M1 using build I20060804-0010.
Comment 6 Dani Megert CLA 2006-08-10 03:46:35 EDT
You might want to revist this, see also comments in bug 153399.
Comment 7 Olivier Thomann CLA 2006-09-11 13:32:57 EDT
Verified for 3.2.1 using build M20060908-1655.