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

Bug 358126

Summary: Error when adding/removing comment block delimiter
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: EditorAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: eclipse.felipe, Silenio_Quarti
Version: 0.2   
Target Milestone: 0.3 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2011-09-19 10:46:18 EDT
Orion HEAD from 09/19

1. Open an existing .js file that contains some /* .. */ comment blocks.
2. Put the editing caret after a */ delimiter and press Backspace to delete it.
3. You'll get an error:

Uncaught TypeError: Object #<Object> has no method 'getBaseModel'
FoldingAnnotation._update                                           annotations.js:43
FoldingAnnotation                                                   annotations.js:36
TextStyler._createFoldingAnnotation                                 textStyler.js:677
TextStyler._onModelChanged                                          textStyler.js:808
EventTable.sendEvent                                                textView.js:180
TextView.onModelChanged                                             textView.js:946
TextView._onModelChanged                                            textView.js:4084
TextView._hookEvents._modelListener.onChanged                       textView.js:3693
TextModel.onChanged                                                 textModel.js:339
TextModel.setText                                                   textModel.js:484
TextView._modifyContent                                             textView.js:4064
TextView._doBackspace                                               textView.js:2275
TextView._createActions._actions.defaultHandler                     textView.js:2872
TextView._doAction                                                  textView.js:2244
TextView._handleKeyDown                                             textView.js:1642
TextView._hookEvents.handlers.push.handler                          textView.js:3721

At this point the editor is in a corrupt state and must be reloaded.
A similar error happens when you add a new comment block by typing in the /* delimiter.
Comment 1 Felipe Heidrich CLA 2011-09-19 12:04:48 EDT
our bad, pushing fix in a sec
Comment 2 Felipe Heidrich CLA 2011-09-19 12:11:57 EDT
Hi Mark, can pull and verified the fix ? thanks
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0de793a8637f4535297be3f78ca07a1d2bb1d788
Comment 3 Mark Macdonald CLA 2011-09-19 12:39:12 EDT
(In reply to comment #2)
The fix works, thanks