Aptana Studio
  1. Aptana Studio
  2. APSTUD-3390

Snippet tab stops fail, cause IllegalStateException: model is already installed

    Details

      Description

      Reproduction steps:

      1. Create a new PHP project
      2. Create a new PHP file inside that project
      3. Open the file and type:
        <?php
        ?>
        
      4. Inside the PHP block, type "if" + Tab (no quotes). It should insert an "if" block snippet.
      5. If you attempt to tab through the stops, only the first one works, and it inserts a "tab". Subsequent tab presses only jump to where the cursor is.

      Error in log:

      !ENTRY org.eclipse.ui 4 0 2011-08-27 06:33:51.898
      !MESSAGE Unhandled event loop exception
      !STACK 0
      java.lang.IllegalStateException: model is already installed
      	at org.eclipse.jface.text.link.LinkedModeModel.addGroup(LinkedModeModel.java:413)
      	at com.aptana.editor.common.scripting.snippets.SnippetTemplateProposal.doApply(SnippetTemplateProposal.java:277)
      	at com.aptana.editor.common.scripting.snippets.SnippetTemplateProposal.apply(SnippetTemplateProposal.java:123)
      	at com.aptana.editor.common.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:912)
      	at com.aptana.editor.common.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:849)
      	at com.aptana.editor.common.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1485)
      	at com.aptana.editor.common.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:1041)
      	at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:489)
      	at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65)
      	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383)
      	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1195)
      	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5957)
      	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5656)
      	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398)
      	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383)
      	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1412)
      	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1408)
      	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:416)
      	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:958)
      	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5075)
      	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
      	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:56)
      	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
      	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
      	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:1959)
      	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2025)
      	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5047)
      	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
      	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4589)
      	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4666)
      	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
      	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
      	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3281)
      	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 com.aptana.rcp.IDEApplication.start(IDEApplication.java:125)
      	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(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:620)
      	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
      	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)                            
      

        Issue Links

          Activity

          Hide
          Ingo Muschenetz added a comment -

          Chris, thoughts?

          Show
          Ingo Muschenetz added a comment - Chris, thoughts?
          Hide
          Ingo Muschenetz added a comment -

          Result of a bad merge and misplaced curly braces.

          Show
          Ingo Muschenetz added a comment - Result of a bad merge and misplaced curly braces.
          Hide
          Joel Witt (Inactive) added a comment -

          Aptana Studio 3, build: 3.0.6.201110121628
          Ubuntu 11.04

          Verification process :

          • Opened a new PHP project
          • Opened a new PHP file in the project
          • Typed PHP block open and close tokens
          • Typed "if" + Tab to select first snippet
          • Verified the end user can tab through all snippet fields
          Show
          Joel Witt (Inactive) added a comment - Aptana Studio 3, build: 3.0.6.201110121628 Ubuntu 11.04 Verification process : Opened a new PHP project Opened a new PHP file in the project Typed PHP block open and close tokens Typed "if" + Tab to select first snippet Verified the end user can tab through all snippet fields
          Hide
          Ingo Muschenetz added a comment -

          Had to reopen for label

          Show
          Ingo Muschenetz added a comment - Had to reopen for label

            People

            • Assignee:
              Ingo Muschenetz
              Reporter:
              Ingo Muschenetz
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: