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

Bug 350379

Summary: Text in PHP editor acts weird after typing a "<" character
Product: z_Archived Reporter: Stefan Bossbaly <Sbossb>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P1 CC: adamsb, ganoro, ilina.s, kalin.a, kamazee, kasperjin, moisizz, Sbossb
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Texting jumping around after the < character is pressed
none
A the text selected from the previous picture
none
colored whitespace characters
none
Tried to type <blah-blah before that colored whitespace none

Description Stefan Bossbaly CLA 2011-06-26 10:48:41 EDT
Build Identifier: 20110615-0604

In the php editor whenever I type a < character the editor freezes up. Then character after I type do not display until a random point. After that the text jumps all over the screen when typing. I will include screen shot to help my description. I have tried a complete reinstall with no luck.

Reproducible: Sometimes

Steps to Reproduce:
1. Open a PHP file
2. Start typing HTML code and PHP code. Make sure to use the '<' character
3. The bug should be able to be seen
Comment 1 Stefan Bossbaly CLA 2011-06-26 10:50:18 EDT
Created attachment 198609 [details]
Texting jumping around after the < character is pressed
Comment 2 Stefan Bossbaly CLA 2011-06-26 10:51:29 EDT
Created attachment 198610 [details]
A the text selected from the previous picture
Comment 3 Stefan Bossbaly CLA 2011-06-28 19:11:38 EDT
I also notice on the left side of the editor window where the the number counter for the code lines disappears when this bug occurs.

Also when I to undo a change after the text jumps all over the place it throws and error. Here is the stack trace.

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:4263)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.SWT.error(SWT.java:4168)
	at org.eclipse.swt.custom.StyledText.setSelectionRange(StyledText.java:9526)
	at org.eclipse.jface.text.TextViewer.setSelectedRange(TextViewer.java:2395)
	at org.eclipse.jface.text.TextViewer.setSelection(TextViewer.java:2531)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.undoOperationSelectionChanged(StructuredTextViewer.java:872)
	at org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager.setUndoDocumentSelection(StructuredTextUndoManager.java:591)
	at org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager.undo(StructuredTextUndoManager.java:634)
	at org.eclipse.wst.sse.ui.StructuredTextViewerUndoManager.undo(StructuredTextViewerUndoManager.java:183)
	at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3958)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:1012)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1534)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:613)
	at org.eclipse.php.internal.ui.editor.PHPStructuredTextViewer.doOperation(PHPStructuredTextViewer.java:305)
	at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:128)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:126)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1531)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3019)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5016)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4408)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8394)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1245)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2258)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 4 Alex CLA 2011-07-09 10:02:04 EDT
Created attachment 199371 [details]
colored whitespace characters
Comment 5 Alex CLA 2011-07-09 10:03:33 EDT
Created attachment 199372 [details]
Tried to type <blah-blah before that colored whitespace
Comment 6 Alex CLA 2011-07-09 10:03:50 EDT
This one affects me too.

Seems like editor freezes not on every '<', but on some of '<' preceded by '>' and/or line break.

Also visible whitespace characters (\n in my case) get colored after some '>'. So, when I try to place '<' right before or after that colored newline sign preceded by '>', editor stars behaving oddly.

Ubuntu 11.04, x64.
$ uname -a
Linux kamazee 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
openjdk-6-jre 6b22-1.10.2-0ubuntu1~11.04.1

Attached 2 images: file with colored whitespace and result of an attempt to type '<blah-blah' right before one of the colored newilne characters.
Comment 7 Alex CLA 2011-07-19 08:13:54 EDT
Little more details.
Symbols after '<' get broken at the end of the line when the next line begins with <?php (indented or not).
Comment 8 Brian Adams CLA 2011-07-24 12:45:51 EDT
I can confirm this issue happens on Windows 7 as well:

Windows 7
Eclipse 3.7.0
PDT 3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O

Alex's description in comment 7 seems to be spot on.
Comment 9 Stefan Bossbaly CLA 2011-07-24 13:52:36 EDT
Thanks for confirming the bug on windows. I have changed the importance of the bug to major because there are no known workarounds (except for downgrading) and PDT becomes unusable with this bug.
Comment 10 Kasper Pedersen CLA 2011-07-25 09:48:52 EDT
I can also confirm this bug on OS X Lion.

Mac OS X 10.7
Eclipse 3.7.0
PDT 3.0.0.v20110516
Comment 11 Brian Adams CLA 2011-07-25 10:06:06 EDT
I do agree that this should be a major priority.

For those who are running into this, one can throw an html comment tag <!-- --> before the offending php tag and get the editor to behave.  It's not ideal by any stretch of the imagination, but it does keep the code flowing.
Comment 12 Stefan Bossbaly CLA 2011-07-25 17:49:24 EDT
Well at least there is some kind of workaround. Since Kasper confirmed it on OSX, I changed the platform affected to all.
Comment 13 Roy Ganor CLA 2011-07-26 08:43:07 EDT
let's make this bug priority higher...
Comment 14 Zhongwei Zhao CLA 2011-08-01 03:33:46 EDT
I tested this bug on winxp and ubuntu.
Kalin tested this bug on linux.
Ilina tested this bug on windows 7.

All of us could not reproduce this bug!

And we hope you can upload the files instead of screen shots,thanks very much!
Comment 15 Kasper Pedersen CLA 2011-08-01 11:37:51 EDT
(In reply to comment #14)
> And we hope you can upload the files instead of screen shots,thanks very much!

What files do you need? Let me know and I'll gladly post whatever would be useful :)


I've noticed the PHPTaskValidator-task getting stuck. It works fine prior to the bug being triggered, but afterwards it just sits there, stuck (in my case at 50%, every time). Canceling the operation doesn't help and Eclipse can't shut down properly - I have to force quit Eclipse.
Anyone else seeing this?
Comment 16 Toshihiro Izumi CLA 2011-08-02 03:37:50 EDT
Duplicate of bug 350139.
Comment 17 Roy Ganor CLA 2011-08-09 05:12:24 EDT
Per last comment, closing...

*** This bug has been marked as a duplicate of bug 350139 ***
Comment 18 Kalin CLA 2011-10-18 04:26:45 EDT
Closing as a Duplicate of 350139