Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312439 - Improper cursor jumps when using associative arrays in content assist
Summary: Improper cursor jumps when using associative arrays in content assist
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Zhongwei Zhao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 10:54 EDT by Marijn CLA
Modified: 2020-05-14 11:07 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marijn CLA 2010-05-11 10:54:44 EDT
When I use content assist in PDT 2.2M7 (all-in-one package from the download site with additionally installed DTP and Subclipse), the cursor makes improper jumps when filling in an associative array as the parameter.

Example to reproduce:

1. Create a new php file starting with <?php
2. Start typing: is_f
3. Use content assist (ctrl+space) to pick the function: is_file
4. Start typing as the first parameter: $param[
5. When you type the opening bracket [, the cursor jumps back to inbetween the 'm' and '['
6. Move the cursor one ahead so its properly after '[' again
7. Continue typing: " (single-quote ' also works)
8. The cursor jumps back again now between '[' and '"'

Example code:
<?php 
is_file($param['foo']);
?>

Regards,

Marijn.
Comment 1 Zhongwei Zhao CLA 2010-05-12 00:04:44 EDT
hi Marijn,

What is your setting in PHP->Editor->Typing preference page?

I can not reproduce this bug following your steps.Thanks
Comment 2 Marijn CLA 2010-05-12 03:48:44 EDT
I was able to reproduce the problem following my steps on a clean install (no modifications) of eclipse-php-helios-M7-win32.zip, with a clean workspace. Settings default there to all selected for "Automatically close" ("Tab key indents the current line" is unchecked).

Followed the following steps:
1. Extract eclipse-php-helios-M7-win32.zip to an empty directory
2. Start Eclipse from the new install
3. Choose a non-existing workspace directory (so that a fresh one is created)
4. Create a new PHP project
5. Continue with steps as described in the original report
Comment 3 Zhongwei Zhao CLA 2010-05-12 04:55:08 EDT
Thanks,I can reproduce it now.
Comment 4 Zhongwei Zhao CLA 2010-05-13 02:07:22 EDT
fixed in head
Comment 5 Gadi Goldbarg CLA 2010-05-17 09:37:47 EDT
Verified at PDT-2.2.0.v20100517

After typing [ cursor stay at right position
After typing " or ' cursor again stay at right position

Closing this issue...

Verified by
Teodor Kirkov
Comment 6 Zhongwei Zhao CLA 2010-06-02 04:49:36 EDT
another case:
<?php
define|//cursor

use CA then choose define function,the content will be:
<?php
define($name, $value)
choose $value,then type ',the dursor will go to the end of line.
Comment 7 Zhongwei Zhao CLA 2010-06-02 04:53:08 EDT
(In reply to comment #6)
> another case:
> <?php
> define|//cursor
> 
> use CA then choose define function,the content will be:
> <?php
> define($name, $value)
> choose $value,then type ',the dursor will go to the end of line.
fixed this case in head
Comment 8 Gadi Goldbarg CLA 2010-06-18 03:01:40 EDT
Verified at PDT-2.2.0.v20100616
In case that zhaozhongwei mention now it is ok

Closing for now this issue, but feel free to reopened if can see the same bad behavior at some another cases of using CA

Verified by
Teodor Kirkov
teodor.k@zend.com