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

Bug 350139

Summary: Cannot type HTML code inside of a PHP code block - can lead to file corruption.
Product: z_Archived Reporter: Nate <mackeyn>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact: Ilina Stefanova <ilina.s>
Severity: critical    
Priority: P1 CC: bryan, dmc, eclipse, eclipse, ganoro, kalin.a, kamazee, kostas.job, mitchell.hall, Sbossb, tampe125.pub, thatnitind, tszming, veseliq, victor, wayne.beaton, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
my current patch none

Description Nate CLA 2011-06-23 08:59:35 EDT
Build Identifier: I20110613-1736

When trying to type HTML code inside of a PHP code block, the opening "<" character is invisible until you move the cursor using an arrow key or mouse.  If you continue typing without moving the cursor, the input is inserted before the "<" character.

Here's an example:

First enter the following code:
<?php if (true): ?>
  
<?php endif ?>

Next try to type "<div>" on the blank line between the if and endif.  If you close and open that file and try again, the file contents around where you're typing start to get mangled.  Entering HTML outside of the if/endif block works fine.  I've also tried an if block using curly brackets "{}" and a while loop which both have the same result.

eclipse.buildId=I20110613-1736
java.version=1.6.0_24
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring ~/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring ~/.eclipse_keyring -showlocation

Below are the exceptions from the eror log.  The first exception seems to trigger the other ones after the initial "<" is entered.

Unhandled event loop exception
java.lang.Error: Error: could not match input
	at org.eclipse.wst.xml.core.internal.parser.XML10Names.zzScanError(XML10Names.java:473)
	at org.eclipse.wst.xml.core.internal.parser.XML10Names.isValidXML10Name(XML10Names.java:588)
	at org.eclipse.wst.xml.core.internal.parser.XML10Names.isValidXML10Name(XML10Names.java:271)
	at org.eclipse.wst.xml.core.internal.provisional.NameValidator.isValid(NameValidator.java:50)
	at org.eclipse.wst.xml.core.internal.document.DocumentImpl.isValidName(DocumentImpl.java:1015)
	at org.eclipse.wst.xml.core.internal.document.DocumentImpl.checkTagNameValidity(DocumentImpl.java:258)
	at org.eclipse.php.internal.core.documentModel.dom.DOMDocumentForPHP.createElement(DOMDocumentForPHP.java:44)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertStartTag(XMLModelParser.java:1482)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertStructuredDocumentRegion(XMLModelParser.java:1510)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.replaceStructuredDocumentRegions(XMLModelParser.java:2354)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.nodesReplaced(DOMModelImpl.java:737)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:600)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1198)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1979)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2456)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5911)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494)
	at org.eclipse.swt.widgets.Control.insertText(Control.java:2056)
	at org.eclipse.swt.widgets.Canvas.insertText(Canvas.java:256)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5558)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5470)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2255)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4986)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5135)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
	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)


assertion failed: 
org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.handleAboutToBeChanged(DocumentLineDiffer.java:794)
	at org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer.documentAboutToBeChanged(DocumentLineDiffer.java:763)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireDocumentAboutToChange(BasicStructuredDocument.java:389)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireDocumentAboutToChanged(BasicStructuredDocument.java:1120)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1912)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2242)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6988)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5915)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:463)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1051)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5560)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5470)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2255)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4986)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5135)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
	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)


IStructuredDocumentRegion management failed.
org.eclipse.wst.xml.core.internal.document.StructuredDocumentRegionManagementException: IStructuredDocumentRegion management failed.
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2258)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.changeStructuredDocumentRegion(XMLModelParser.java:546)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.changeTagName(XMLModelParser.java:570)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.changeRegion(XMLModelParser.java:347)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.regionChanged(DOMModelImpl.java:791)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:542)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1180)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1964)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2242)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6988)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5915)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:463)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1051)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5560)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5470)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2255)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4986)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5135)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
	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)


Problems occurred when invoking code from plug-in: "org.eclipse.text".
java.lang.IllegalArgumentException: Index out of bounds
	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.setStyleRanges(StyledText.java:9661)
	at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7713)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4811)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4890)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.applyTextRegionCollection(StructuredPresentationReconciler.java:893)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processDamage(StructuredPresentationReconciler.java:868)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.processRecordedDamages(StructuredPresentationReconciler.java:840)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler$InternalListener.textChanged(StructuredPresentationReconciler.java:414)
	at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2824)
	at org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:403)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:769)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:736)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:721)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:796)
	at org.eclipse.jface.text.projection.ProjectionDocument.fireDocumentChanged(ProjectionDocument.java:777)
	at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentChanged(ProjectionDocument.java:746)
	at org.eclipse.jface.text.projection.ProjectionDocumentManager.fireDocumentEvent(ProjectionDocumentManager.java:123)
	at org.eclipse.jface.text.projection.ProjectionDocumentManager.documentChanged(ProjectionDocumentManager.java:131)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireDocumentChanged(BasicStructuredDocument.java:460)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1184)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1964)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7180)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7994)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2242)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6988)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5915)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5941)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5635)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:463)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1051)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5560)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5470)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2255)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4986)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5135)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
	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)


Reproducible: Always

Steps to Reproduce:
1. Download the latest version of Eclipse Indigo/3.7 - Classic - Mac OS X 64bit
2. Extract tar.gz file
3. Start eclipse using a brand new workspace folder
4. Click Help -> Install New Software
5. Select the Indigo update site (I've also tested this using the latest Milestone release of PDT with the same result)
6. Expand Programming Languages and select PHP Development Tools (PDT) SDK Feature
7. Install the software
8. Restart Eclipse
9. Create a brand new PHP project
10. Create a new .php file
11.  Type in "<?php if (true): ?>"
12.  Enter a blank line on the second line
13.  Type in "<?php endif ?>" on the third line
14.  Go back to the second line and start to type "<div>content</div>".
Comment 1 dominik CLA 2011-06-27 12:50:52 EDT
Reading this error I found that this can be duplicate of mine submitted #345068: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345068
Comment 2 dominik CLA 2011-06-27 12:55:38 EDT
I pasted wrong id, it should be: 350468
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350468
Comment 3 Toshihiro Izumi CLA 2011-06-28 04:29:22 EDT
Steps to reproduce on Windows:

1. Create new php file
2. Insert new line above php-open-tag
  1:
  2: <?php
  3:
3. File > Convert Line Delimiters To > Unix
4. Move cursor to line 1, and hit "<"

No "<" echo back.
"java.lang.Error: Error: could not match input" is recorded in .log.
Comment 4 Zhongwei Zhao CLA 2011-06-29 03:33:21 EDT
Hi,

I can only reproduce Toshihiro's issue.but depend on the error log,I think I have fixed original bug.
Comment 5 dominik CLA 2011-06-29 04:41:19 EDT
Great to hear, how can I test that? 
BTW: I would like to help with this project, can You contact me how can I get involved with tests? Having many PHP projects sometimes it's easier to hit some bug and judge what is important and what block work. There is my e-mail in cc list for this bug. So on I was just updating from pdt channel and then writing about new version from there. Maybe there is better way to help.
Comment 6 Nate CLA 2011-06-29 08:28:05 EDT
Is there a nightly build that I can download and test?
Comment 7 Zhongwei Zhao CLA 2011-06-29 09:52:25 EDT
to dominik:thanks very much!now the nightly build fails for a long time,I will try to fix it tomorrow,and then if it works,you can download it there!And then install it.

to Nate:see the comment to dominik:)
Comment 8 dominik CLA 2011-06-29 10:19:28 EDT
Ok, great, I will try it ASAP,
I have few copies of Eclipse now and make many backups, so this will not disturb my work much,
Comment 9 Toshihiro Izumi CLA 2011-06-30 07:17:56 EDT
<This is my opinion>

I cannot agree with the workaround applied into DOMDocumentForPHP.
The problem is in PHPTokenizer.jflex.

//PHP PROCESSING ACTIONS
<YYINITIAL,ST_XML_TAG_NAME, ST_XML_EQUALS, ST_XML_ATTRIBUTE_NAME, ST_XML_ATTRIBU
TE_VALUE, ST_XML_DECLARATION, ST_XML_DOCTYPE_DECLARATION, ST_XML_ELEMENT_DECLARA
TION, ST_XML_ATTLIST_DECLARATION, ST_XML_DECLARATION_CLOSE, ST_XML_DOCTYPE_ID_PU
BLIC, ST_XML_DOCTYPE_ID_SYSTEM, ST_XML_DOCTYPE_EXTERNAL_ID, ST_XML_COMMENT, ST_X
ML_ATTRIBUTE_VALUE_DQUOTED, ST_XML_ATTRIBUTE_VALUE_SQUOTED, ST_BLOCK_TAG_INTERNA
L_SCAN>{WHITESPACE}* {PHP_START} | {PHP_ASP_START} {

There must not be "{WHITESPACE}*". It includes whitespaces *outside* php code block as php-open-tag.
Also, it causes another issue.
Try hit enter key on line 1 of my example code above. It causes org.eclipse.jface.text.BadLocationException.
Comment 10 Toshihiro Izumi CLA 2011-06-30 07:19:02 EDT
Created attachment 198890 [details]
my current patch

Though I cannot guarantee this is appropriate.
Comment 11 Zhongwei Zhao CLA 2011-07-01 05:25:05 EDT
Hi Toshihiro,

Thanks very much for you patch,I have committed your patch and revert my workaround.


To dominik:
The pdt build now works:
https://hudson.eclipse.org/hudson/job/cbi-pdt-3.0-indigo
Comment 12 dominik CLA 2011-07-01 06:50:34 EDT
zhaozhongwei: great news, I will try it today, can I contact You by E-mail if I have any doubts about this build and it installation? I would like to help with tests and automate installation (or most of it) process to be able to update it frequently.
Comment 13 Zhongwei Zhao CLA 2011-07-01 07:00:14 EDT
sure,you can send me email if you have any question:)
Comment 14 Nate CLA 2011-07-01 08:28:08 EDT
The orignal errors are no longer occurring for me, but now the autocomplete isn't working for HTML or PHP tags within a PHP code block.

Here's how to reproduce:

1. Create a new PHP file
2. Enter "<?php if (true): ?>" on line 1
3. Enter a blank line for the second line
4. Enter "<?php endif ?>" on line 3
5. Go back to line to and type in <div>.  Pressing Ctrl+Space won't autocomplete the tag.  Also Typing "<?" won't auto generate "<?php ?>".  If you move outside of the PHP block (down to line 4) and type either the open div or php tag, it will autocomplete successfully.

Let me know if I should open this as a separate bug.
Comment 15 dominik CLA 2011-07-01 08:46:36 EDT
This is probably same thing, so let's not duplicate reports, I noticed that sometimes only autocompletion is not working, but editor is responsing normally. I will try newest build and report back if issue is still there.
Comment 16 Zhongwei Zhao CLA 2011-07-01 10:26:02 EDT
Pressing Ctrl+Space won't autocomplete the tag.This happens to me!

I will have a look at it,thanks,but <? generates "<?php ?>" for me...
Comment 17 Zhongwei Zhao CLA 2011-07-01 10:35:06 EDT
I tried normal html in html editor,I can reproduce "Pressing Ctrl+Space won't autocomplete the tag."

Can you?
Comment 18 dominik CLA 2011-07-01 15:18:16 EDT
I'm downloading build now on my home computer, I hope I will manage to run everything. 

As I said I have project which acts exactly like Nate described, but I'm almost sure that it's same bug as I reported. In fact I wanted yesterday show that bug to friend and I was surprised that it not broke editor like and just not autocompleted tag. This may be some differences in settings or language version (this was old project and maybe it's set as < 5.3)
Comment 19 dominik CLA 2011-07-01 21:39:47 EDT
Current nightly build fixed this issue, thanks Zhaozhongwei and Toshihiro Izumi :) 
I will be more active here on bugzilla, on monday I'll test with this issue next two computers in my work, later I'll read more bugs and try to reproduce them so maybe somehow this will help
Comment 20 Zhongwei Zhao CLA 2011-07-02 00:11:50 EDT
(In reply to comment #19)
> Current nightly build fixed this issue, thanks Zhaozhongwei and Toshihiro Izumi
> :) 
> I will be more active here on bugzilla, on monday I'll test with this issue
> next two computers in my work, later I'll read more bugs and try to reproduce
> them so maybe somehow this will help

Thanks very much for you help;)

I tried normal html in html editor,I can reproduce "Pressing Ctrl+Space won't
autocomplete the tag."

Can you?

Now I am not sure if this is PDT bug.
Comment 21 dominik CLA 2011-07-04 04:34:41 EDT
I updated next two computer, 
yes, I can reproduce that, 

Also I noticed that there is something wrong with PHP code with mixed content (HTML/PHP), to reproduce: 

1. download osCommerce (this is old freeware project) 
2. open admin/categories.php 
3. at the bottom enter there should be: 
<?php require (DIR_WS_INCLUDES . 'application_bottom.php'); ?>
4. enter after ufter that in same line: "<?php" 
5. many errors will be displayed in error log (I think two for each typed char), errors are: Invalid Hierarchy Request, IStructuredDocumentRegion management failed.

org.w3c.dom.DOMException: Invalid Hierarchy Request
	at org.eclipse.wst.xml.core.internal.document.ElementImpl.insertBefore(ElementImpl.java:754)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertNode(XMLModelParser.java:1360)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertNode(XMLModelParser.java:1334)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertPI(XMLModelParser.java:1387)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.insertStructuredDocumentRegion(XMLModelParser.java:1526)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.replaceStructuredDocumentRegions(XMLModelParser.java:2354)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.handleRefresh(DOMModelImpl.java:524)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.nodesReplaced(DOMModelImpl.java:742)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:600)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1198)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1979)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7178)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7992)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2266)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6986)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5913)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5939)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5633)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4623)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4511)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4957)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2525)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3737)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)


org.eclipse.wst.xml.core.internal.document.StructuredDocumentRegionManagementException: IStructuredDocumentRegion management failed.
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2258)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2288)
	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.replaceStructuredDocumentRegions(XMLModelParser.java:2339)
	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.nodesReplaced(DOMModelImpl.java:737)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:600)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1198)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1979)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2408)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7178)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7992)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2266)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6986)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5913)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5939)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5633)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4623)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4511)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4957)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2525)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3737)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)


I don't know if this is connected with last change, I just noticed that. Very old php project, wrote with many files with mixed content may be good example to test PHP project structure. On the other hand it's good to test symfony based projects - that's much better in code and uses mixed content in templates.
Comment 22 dominik CLA 2011-07-04 04:43:44 EDT
I can reproduce error described by Nate in comment 14 with <div> in the middle with build from friday.
Comment 23 Zhongwei Zhao CLA 2011-07-04 04:56:22 EDT
ah...I see,but I think it is not pdt's issue:(
Comment 24 Nate CLA 2011-07-05 09:24:43 EDT
Who then is responsible for the issue and how do we get them to fix it?
Comment 25 Toshihiro Izumi CLA 2011-07-05 22:43:14 EDT
(In reply to comment #14)
> The orignal errors are no longer occurring for me, but now the autocomplete
> isn't working for HTML or PHP tags within a PHP code block.
> 
> Here's how to reproduce:
> 
> 1. Create a new PHP file
> 2. Enter "<?php if (true): ?>" on line 1
> 3. Enter a blank line for the second line
> 4. Enter "<?php endif ?>" on line 3
> 5. Go back to line to and type in <div>.  Pressing Ctrl+Space won't
> autocomplete the tag.  Also Typing "<?" won't auto generate "<?php ?>".  If you
> move outside of the PHP block (down to line 4) and type either the open div or
> php tag, it will autocomplete successfully.
> 
> Let me know if I should open this as a separate bug.

Nate,
The behaviour of your pdt seems a bit different with mine.
When typing "<" on line 2, content-assist pops up and it shows "HTML 4.01 Transitional Document Type" and some template proposals(with "#" icon). No any html tags. Ctrl+Space doesn't show any html tags(this may be same as you).
When typing "?" after "<", "<?php ?>" is generated.
When typing "<" outside php block(down to line 4), the behaviour is same as on line 2.

As for auto-generation, it requires that Preferences>PHP>Editor>Typing>Add "php" after... must be checked.

As for html tags, it must be expected behaviour. (also, same as former version)
Try insert "<html>" at the top of the script(line 1) and type "<" on line 3. You'll see html tags.
Content assist for html is *context-sensitive*. It shows possible tags depends on the context, maybe. That functionarity is provided by WTP. I don't know the detail though.
Comment 26 Nate CLA 2011-07-06 08:23:06 EDT
Whatever was changed for the latest build (N201107040915), it fixed my issues.

@Toshihiro, thanks for you response.  Auto-closing of an HTML tag that is typed between two PHP statements has always been a feature of PDT.  I've been using it since 1.0.

Thank you everyone for all of your hard work.  Any idea when an official stable release will be available?
Comment 27 dominik CLA 2011-07-06 11:21:45 EDT
Like Nate I think that this is quite useful feature, right now not critical and don't cause any file corruption, but it's nice to have. 
With modern frameworks it's often used: 
<ul> 
  <?php foreach ($array as $element): ?>
    <li>$element</li>
  <?php endforeach ?> 
</ul
control functions inside this code should not break html completion. I know that it's hard to judge if HTML will generate correctly, but usually nobody writes html end tags in complex conditions etc.
Comment 28 Toshihiro Izumi CLA 2011-07-06 22:51:45 EDT
(In reply to comment #21)

Thanks dominik,
I confirmed following exception on eclipse-php-helios-sr2, by editing <li> line in the code-example of comment #27. It doesn't occur in html file. Could you please open new ticket about this?

> !ENTRY org.eclipse.wst.xml.core 4 4 2011-07-07 11:34:38.890
> !MESSAGE IStructuredDocumentRegion management failed.
> !STACK 0
> org.eclipse.wst.xml.core.internal.document.StructuredDocumentRegionManagementException: IStructuredDocumentRegion management failed.
> 	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.removeStructuredDocumentRegion(XMLModelParser.java:2200)
> 	at org.eclipse.wst.xml.core.internal.document.XMLModelParser.replaceStructuredDocumentRegions(XMLModelParser.java:2339)
> 	at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.nodesReplaced(DOMModelImpl.java:671)
> 	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(BasicStructuredDocument.java:600)
> 	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructuredDocumentEvent(BasicStructuredDocument.java:1198)
> 	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1979)
> 	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2419)
> 	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2404)
> 	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access$2(JobSafeStructuredDocument.java:1)
> 	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument$3.run(JobSafeStructuredDocument.java:141)
> 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> 	at org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContext.java:149)
> 	at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceText(JobSafeStructuredDocument.java:144)
> 	at org.eclipse.wst.sse.ui.internal.StructuredDocumentToTextAdapter.replaceTextRange(StructuredDocumentToTextAdapter.java:1187)
Comment 29 Toshihiro Izumi CLA 2011-07-06 23:15:09 EDT
(In reply to comment #27)
> Like Nate I think that this is quite useful feature, right now not critical and
> don't cause any file corruption, but it's nice to have. 
> With modern frameworks it's often used: 
> <ul> 
>   <?php foreach ($array as $element): ?>
>     <li>$element</li>
>   <?php endforeach ?> 
> </ul
> control functions inside this code should not break html completion. I know
> that it's hard to judge if HTML will generate correctly, but usually nobody
> writes html end tags in complex conditions etc.

Sorry, I could realize your point at last.
I can see html end-tag completion.
1. Move cursor at the end of line 2
2. Hit enter
3. Type "<"
4. CA list "<li>" pops up and then hit enter
5. Type "zzz<"
Now I can see CA list with html tags and "End with /li>".
However,
3. Type "<li>zzz<"
Now I can see CA list with html tags only. No "End with /li>".
(this occurs on eclipse-php-helios-sr2 as well)
I cannot recognize the difference between auto-complete and manual-type. It doesn't make any differences in internal data at the parser level. So I cannot help anymore. Sorry.
Comment 30 Toshihiro Izumi CLA 2011-07-10 04:54:42 EDT
I opened bug 351646 since it is another issue.
Comment 31 Kalin CLA 2011-07-29 06:28:31 EDT
Verified.
Closing ...
Comment 32 Roy Ganor CLA 2011-08-09 05:04:21 EDT
*** Bug 351737 has been marked as a duplicate of this bug. ***
Comment 33 Roy Ganor CLA 2011-08-09 05:12:24 EDT
*** Bug 350379 has been marked as a duplicate of this bug. ***
Comment 34 Alex CLA 2011-08-31 06:16:15 EDT
When is this fix scheduled to appear in the Indigo repos? Current version really needs to be updated because of this bug.

Or is there another way to get current PDT fixed, not via Indigo update site?
Comment 35 Zhongwei Zhao CLA 2011-08-31 08:53:05 EDT
hi,
you can download this file https://hudson.eclipse.org/hudson/job/cbi-pdt-3.0-indigo/196/artifact/build/N201108100912/pdt-Update-N201108100912.zip, and then install it,thanks!
Comment 36 veseliq CLA 2011-11-25 06:57:41 EST
With:

Eclipse
Version: 3.7.1
Build id: M20110909-1335

and

PHP Development Tools (PDT) All-In-One SDK	3.0.0.v20110516-1100-77--7C91A5Ad77OH_pV_hSBYHKz0	org.eclipse.php.all.feature.group	Eclipse.org

This still happens both on Mac and Windows 7...
Comment 37 Mitchell Hall CLA 2012-01-14 18:08:02 EST
I agree with Alex.  This is a huge bug.  Put it into the indigo repository.  What's the wait for?

Still not working with:
Eclipse 3.7.1 M20110909-1335 
PDT 3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O
Comment 38 Ian Remmel CLA 2012-01-30 13:06:34 EST
I too see this error with current versions of Eclipse and the PDT.  In addition, once the error is experienced, the PHP validator gets hung up and I need to force quit Eclipse to get it working again.  

Eclipse 3.7.1 M20110909-1335 
PDT 3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O
Comment 39 Nitin Dahyabhai CLA 2012-02-06 14:30:32 EST
In which release/milestone is this fixed?
Comment 40 Missing name CLA 2012-02-13 08:10:16 EST
is this bug fixed?
where i can find an updated version?
Comment 41 Kostas T CLA 2012-02-14 06:07:56 EST
I also have installed the latest Linux x64 version and this bug is a stopper for PHP development in Eclipse Indigo:

Eclipse 3.7.1 M20110909-1335 
PDT 3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O

Do you guys intend to fix it in the Indigo repos?
Comment 42 Tsz Ming WONG CLA 2012-06-04 00:20:31 EDT
The latest build should have this problem fixed.

https://hudson.eclipse.org/hudson/job/cbi-pdt-3.0-indigo/377/artifact/build/N201206010343/pdt-Update-N201206010343.zip
Comment 43 Jacek Pospychala CLA 2012-06-06 08:06:20 EDT
*** Bug 350468 has been marked as a duplicate of this bug. ***