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

Bug 312914

Summary: [content assist]content assist some times fails to insert the selected value
Product: [WebTools] WTP Source Editing Reporter: Jim Zhang <jzhang>
Component: wst.sseAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev, sarika.sinha
Version: unspecifiedFlags: thatnitind: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to stop inserting pair for double quote if content assist popup is active
none
patch none

Description Jim Zhang CLA 2010-05-14 10:47:43 EDT
Build Identifier: WTP 3.2 M7

This is a rather strange behavior. What happens is when the following circumstances are met, hitting "Enter" at the selected content assist proposal does not get it to be inserted but instead the cursor jumps to the next stop as indicated by the light-green "next caret position" indicator:
1. i type <div algin="", the cursor is automatically placed b/w the quotes, and the content assist is automatically invoked
2. you see the "next caret stop" indicator following the closing quote
3. you make your pick of the content assist proposal using arrow keys
4. you hit enter

This may need to be executed a few times to reproduce the behavior, but I've seen it often enough lately with M7 but not with M6 or earlier.

Reproducible: Sometimes
Comment 1 Sarika Sinha CLA 2010-10-11 14:25:34 EDT
Was able to consistently reproduce this problem. This happens only when the content assist option is selected the first time after <div align="" .If we again move the arrow key and select it works. It works fine if we select the content assist suggestion after typing <div align=
Comment 2 Sarika Sinha CLA 2010-10-13 10:57:06 EDT
Created attachment 180775 [details]
Patch to stop inserting pair for double quote if content assist popup is active

First Enter selection does not work from content assistant popup because of  smart insertion of paired double quote. Attached patch prevents the automatic double quote pair insertion only if content assist popup is active.
Comment 3 Nick Sandonato CLA 2010-10-26 10:43:31 EDT
Sarika, I'd like to expose as little protected stuff as possible. ISourceViewerExtension4 provides the capability of getting the content assist facade which will tell us when a content assist session starts and ends. Unfortunately, SourceViewer marks this method as final. It may also be advantageous to consider utilizing super.configure() a bit.
Comment 4 Nick Sandonato CLA 2010-10-26 10:44:00 EDT
Created attachment 181735 [details]
patch
Comment 5 Nick Sandonato CLA 2010-12-14 15:32:26 EST
Thanks for the review. Checked in.