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

Bug 326247

Summary: Could not open the editor: Argument not valid
Product: z_Archived Reporter: hulebjoern
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aleangelico, ChieftainY2k, ganoro, ghodmode, jacek.pospychala, petyo_tanchev, thaddeusmt, umbertoko
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch
none
patch
none
patch for branch
none
patch for head
none
patch for branch none

Description hulebjoern CLA 2010-09-25 21:35:44 EDT
When this code exists (PHP code inside CSS code) in a PHP file:

<style type="text/css">
#myelement {
	background-image: url(myimage_<?php echo "01"; ?>.png);
}
</style>

The following error occurs when opening that file with the PHP editor:

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:4064)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.SWT.error(SWT.java:3969)
	at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:9683)
	at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:7705)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4803)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4882)
	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$InternalListener.inputDocumentChanged(StructuredPresentationReconciler.java:271)
	at org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler.install(StructuredPresentationReconciler.java:600)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.updateHighlighter(StructuredTextViewer.java:920)
	at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.setDocument(StructuredTextViewer.java:802)
	at org.eclipse.php.internal.ui.editor.PHPStructuredTextViewer.setDocument(PHPStructuredTextViewer.java:638)
	at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:584)
	at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3873)
	at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3401)
	at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:432)
	at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1453)
	at org.eclipse.php.internal.ui.editor.PHPStructuredEditor.createPartControl(PHPStructuredEditor.java:2243)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
	at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:331)
	at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:179)
	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.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	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:369)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)



-- Configuration Details --
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.php.product)
Installed Features:
 org.eclipse.platform 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L
Comment 1 Zhongwei Zhao CLA 2010-09-26 09:40:13 EDT
Created attachment 179586 [details]
patch
Comment 2 Roy Ganor CLA 2010-09-26 18:42:37 EDT
(In reply to comment #1)
> Created an attachment (id=179586) [details]
> patch

after applying the patch the example above works like a charm but the following example throws some warnings in the error log (after typing some chars into the editor):

<div  id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>"></div>

the new exception:
java.lang.IllegalArgumentException: Zero or negative length StyleRange 67:0
at org.eclipse.php.internal.ui.editor.configuration.PresentationCollector.add(PresentationCollector.java:41)
at org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider.prepareTextRegion(AbstractLineStyleProvider.java:298)
at org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider.prepareTextRegions(AbstractLineStyleProvider.java:331)
at org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider.prepareRegions(AbstractLineStyleProvider.java:249)
at org.eclipse.php.internal.ui.editor.configuration.StructuredDocumentDamagerRepairer.createPresentation(StructuredDocumentDamagerRepairer.java:27)
at org.eclipse.php.internal.ui.editor.configuration.PHPStructuredPresentationReconciler.createPresentation(PHPStructuredPresentationReconciler.java:265)
Comment 3 Zhongwei Zhao CLA 2010-09-26 23:09:48 EDT
Created attachment 179597 [details]
patch
Comment 4 Zhongwei Zhao CLA 2010-09-26 23:11:18 EDT
Hi Roy

I could not reproduce your issue,but I think the new patch maybe help fix this,can you try it(you need apply the old patch first then apply the new one),thanks!
Comment 5 Zhongwei Zhao CLA 2010-09-27 02:34:30 EDT
Created attachment 179599 [details]
patch for branch

patch for branch
Comment 6 Zhongwei Zhao CLA 2010-09-27 02:37:37 EDT
Created attachment 179600 [details]
patch for head
Comment 7 Zhongwei Zhao CLA 2010-09-27 23:32:03 EDT
Created attachment 179705 [details]
patch for branch
Comment 8 Zhongwei Zhao CLA 2010-09-28 04:08:05 EDT
fixed in head and branch
Comment 9 Petyo Tanchev CLA 2010-10-05 10:27:09 EDT
Tested on PDT 2.2.1.v20101001
Fixed
Comment 10 Felipe Heidrich CLA 2010-10-12 12:33:15 EDT
*** Bug 327414 has been marked as a duplicate of this bug. ***
Comment 11 Roy Ganor CLA 2010-10-15 18:09:38 EDT
*** Bug 287502 has been marked as a duplicate of this bug. ***
Comment 12 Alex Angelico CLA 2010-10-15 23:00:37 EDT
(In reply to comment #8)
> fixed in head and branch

I have this issue too, how can I apply the patch? I understand there is an update site?

Thanks
Alex
Comment 13 Jacek Pospychala CLA 2010-10-20 17:00:03 EDT
*** Bug 328118 has been marked as a duplicate of this bug. ***
Comment 14 TR CLA 2010-10-22 14:26:11 EDT
Is there a way to apply this patch as binary update to an already installed ide ?