Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370730 - "mark all occurrencies" fails after a specific kind of code
Summary: "mark all occurrencies" fails after a specific kind of code
Status: RESOLVED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 10:08 EST by Germano Massullo CLA
Modified: 2012-02-23 11:30 EST (History)
1 user (show)

See Also:


Attachments
CDT components version (51.55 KB, image/png)
2012-02-06 10:09 EST, Germano Massullo CLA
no flags Details
Code that triggers the bug (6.39 KB, application/octet-stream)
2012-02-06 10:11 EST, Germano Massullo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!