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

          No builds found.
          Ingo Muschenetz created issue -
          Hide
          Ingo Muschenetz added a comment -

          Chris, thoughts?

          Show
          Ingo Muschenetz added a comment - Chris, thoughts?
          Ingo Muschenetz made changes -
          Field Original Value New Value
          Assignee Ingo Muschenetz [ ingo ] Chris Williams [ cwilliams ]
          Ingo Muschenetz made changes -
          Assignee Chris Williams [ cwilliams ] Ingo Muschenetz [ ingo ]
          Ingo Muschenetz made changes -
          Fix Version/s Aptana Studio 3.1 [ 11505 ]
          Ingo Muschenetz made changes -
          Assignee Ingo Muschenetz [ ingo ] Michael Xia [ mxia ]
          Fix Version/s Aptana Studio 3.0.6 [ 12271 ]
          Fix Version/s Aptana Studio 3.1 [ 11505 ]
          Affects Version/s Aptana Studio 3.0.5 [ 11504 ]
          Priority Medium [ 3 ] High [ 2 ]
          Description Unfortunately not sure how to reproduce, but happened while typing with snippets.

          {code}
          !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)
          {code}
          Reproduction steps:

          # Create a new PHP project
          # Create a new PHP file inside that project
          # Open the file and type: \\
          {code}
          <?php
          ?>
          {code}
          # Inside the PHP block, type "if" + Tab (no quotes). It should insert an "if" block snippet.
          # 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:
          {code}
          !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)
          {code}
          Ingo Muschenetz made changes -
          Summary IllegalStateException: model is already installed Snippet tab stops fail, cause IllegalStateException: model is already installed
          Ingo Muschenetz made changes -
          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.
          Ingo Muschenetz made changes -
          issue.field.resolutiondate 2011-10-11 13:01:41.0 2011-10-11 13:01:41.554
          Ingo Muschenetz made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Michael Xia [ mxia ] Ingo Muschenetz [ ingo ]
          Resolution Fixed [ 1 ]
          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
          Joel Witt (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Ingo Muschenetz made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Ingo Muschenetz made changes -
          Labels notable
          Ingo Muschenetz made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Ingo Muschenetz added a comment -

          Had to reopen for label

          Show
          Ingo Muschenetz added a comment - Had to reopen for label
          Ingo Muschenetz made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Nikolai Derzhak made changes -
          Workflow Appc-Jira [ 92610 ]  PyDev migration copy of Appc-Jira [ 115817 ]
          Nikolai Derzhak made changes -
          Workflow  PyDev migration copy of Appc-Jira [ 115817 ] Appc-Jira [ 123459 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          43d 3h 33m 1 Ingo Muschenetz 11/Oct/11 6:01 AM
          Closed Closed Reopened Reopened
          7d 3h 53m 1 Ingo Muschenetz 25/Oct/11 8:41 AM
          Reopened Reopened Resolved Resolved
          16s 1 Ingo Muschenetz 25/Oct/11 8:41 AM
          Resolved Resolved Closed Closed
          6d 22h 46m 2 Ingo Muschenetz 25/Oct/11 8:42 AM

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development