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

Bug 316374

Summary: enhancement request: quick fix to add symbol
Product: [Tools] CDT Reporter: Mike Kucera <mikekucera>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: zeratul976
Version: 6.0.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mike Kucera CLA 2010-06-09 16:12:33 EDT
Often while I'm coding I run across inactive code blocks that I would like to make active. To do that I have to go to the project properties, navigate to paths and symbols and add the symbol manually. Kind of inconvenient.

I'm thinking this could be done as a quick fix. Just put the cursor on the #ifdef, hit ctrl-1, and pick "enable symbol" or something like that.

That would need to trigger the indexer. The file where the quick fix is invoked should be the first to be reindexed so that it appears as though the quick fix has an immediate effect.
Comment 1 Nathan Ridge CLA 2017-01-05 22:55:07 EST
Interesting request.

What should happen if the block was '#ifndef SYMBOL', and it was inactive because SYMBOL was already defined?

Should it also work for '#if defined(SYMBOL)'? For '#if defined(FOO) && defined(BAR)'? For '#if GNU_VERSION >= 4'?