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

Bug 370730

Summary: "mark all occurrencies" fails after a specific kind of code
Product: [Tools] CDT Reporter: Germano Massullo <germano.massullo>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: RESOLVED INVALID QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
CDT components version
none
Code that triggers the bug none

Description Germano Massullo CLA 2012-02-06 10:08:57 EST
Build Identifier: Eclipse Version: 3.7.1 Build id: R3_7_1

The feature "mark all occurrencies" is bugged, so after a certain type of code, it no longer marks all occurrencies of a word you just clicked on.

I am going to attach:
- an image file with version of all CDT components I have
- a C file with the code that reproduces the bug

Reproducible: Always

Steps to Reproduce:
1.Open an empty C source file and paste inside it the code I attatched here
2.Make sure toolbar button "Toggle mark all occurrencies" is enabled
3.Click on a random word after the "do" command (about line number 65)
Comment 1 Germano Massullo CLA 2012-02-06 10:09:40 EST
Created attachment 210592 [details]
CDT components version
Comment 2 Germano Massullo CLA 2012-02-06 10:11:14 EST
Created attachment 210593 [details]
Code that triggers the bug
Comment 3 Anton Leherbauer CLA 2012-02-06 10:47:46 EST
The whole do{} loop is marked as syntax error and there is a good reason:

do { 
  //...
}

is no valid syntax. It should be instead:

do {
  //...
} while(condition);

Mark occurrences works only with valid C/C++ code.
Comment 4 Germano Massullo CLA 2012-02-06 10:55:00 EST
Sorry BUT I think that should work even if you are currently having non valid code, since you are still coding it!