Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: Re[cdt-dev] factoring Preconditions

Hi Markus I've submitted the bug.. Hopefully a solution comes up for it. I'm
hoping to add my own prototype C refactorings to the org.eclipse.cdt.ui
plugin so it would be interesting to know if the infrastructure is there to
check the scope for macros which may refer to a particular entity. 

P.S Is Eclipse CDT supposed to have the functionality to show the warning
symbol next to unreferenced variables?


Schorn, Markus wrote:
> 
> This is a limitation of the rename-refactoring for local variables,
> you may want to raise a bug.
> In general you can search the index for references of an entity.
> --> CCorePlugin.getIndexManager().
> Local variables are not stored in the index, so you need to work
> directly with the AST in this case.
> --> ITranslationUnit.getAST(...).
> 
> Markus.
> 
>> -----Original Message-----
>> From: cdt-dev-bounces@xxxxxxxxxxx 
>> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of student08
>> Sent: Monday, May 12, 2008 2:14 PM
>> To: cdt-dev@xxxxxxxxxxx
>> Subject: Re[cdt-dev] factoring Preconditions
>> Importance: Low
>> 
>> 
>> Hi I've been trying out the refactorings in CDT 5.0 as I was 
>> hoping to do a prototype extension of the refactorings which 
>> are currently available. I was wondering if the refactorings 
>> were developed with Garrido's PHD thesis on refactoring in 
>> the presence of preprocessor directives in mind as it seems 
>> that the preconditions checking don't extend to preprocessor 
>> directives. 
>> 
>> For example with the rename refactoring, I could define a 
>> macro which say makes reference to a variable which is only 
>> used within the scope of a particular function yet if I were 
>> to perform a rename refactoring on that particular variable 
>> it wouldn't check the macro definitions of macros called from 
>> within that function to see if they referred to that variable 
>> and block the refactoring.
>> 
>> e.g
>> 
>> #define COUNT i=i+1
>> 
>> void perform_counting (void) {
>> 
>> int i; <- rename i
>> 
>> i = 0;
>> 
>> while (i < 10) {
>> 
>> COUNT
>> 
>> }
>> 
>> return;
>> }
>> 
>> Is this due to limitations with the parser and ast 
>> representation and is there an easy way to check all scopes 
>> in which a particular element is referenced project-wide?
>> 
>> 
>> --
>> View this message in context: 
>> http://www.nabble.com/Refactoring-Preconditions-tp17186373p171
> 86373.html
>> Sent from the Eclipse CDT - Development mailing list archive 
>> at Nabble.com.
>> 
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Refactoring-Preconditions-tp17186373p17233410.html
Sent from the Eclipse CDT - Development mailing list archive at Nabble.com.



Back to the top