Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Add Include working without a selection?
Add Include working without a selection? [message #1012152] Thu, 21 February 2013 01:20 Go to next message
Jesse Weinstein is currently offline Jesse Weinstein
Messages: 44
Registered: July 2012
Member
I'm confused about whether Add Include will work without anything selected. It appears to do so (details below), but my reading of the code suggests that it shouldn't. So I'm confused.

Here's the code that makes me think it shouldn't do anything if there is no selection:
if (selection.isEmpty() || !(selection instanceof ITextSelection)) {
    return;
}
from AddIncludeOnSelectionAction.java

And here's how I seem to be able to make it do things:

I have a class implementation file: someClass.cpp, containing an implementation of a single method, and without any #includes. If I run "Add Include" without anything selected, it adds an include for the header file where the class is declared, #include "someClass.h".

What's going on here?
Re: Add Include working without a selection? [message #1022374 is a reply to message #1012152] Thu, 21 March 2013 19:13 Go to previous message
Jesse Weinstein is currently offline Jesse Weinstein
Messages: 44
Registered: July 2012
Member
cdt-dev thread (with responses!) here.
Previous Topic:ASTRewrite: Preserving comments and formatting?
Next Topic:Debug Problem - No symbol table is loaded. Use the "file" command.
Goto Forum:
  


Current Time: Tue Sep 30 22:06:13 GMT 2014

Powered by FUDForum. Page generated in 0.02766 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software