Skip to main content
Jump to: navigation, search

Difference between revisions of "CDT/User/NewIn93"

< CDT
(Additional gcc Quick-fixes)
(Additional gcc Quick-fixes)
Line 95: Line 95:
 
== Code Analysis ==
 
== Code Analysis ==
  
=== Additional gcc Quick-fixes ===
+
=== Gcc Build Quick-fixes ===
  
Quick fixes have been added for a variety of errors generated by the gcc compiler.  Such
+
Quick fixes have been added for a variety of build errors generated by the gcc compiler.  Such
 
fixes include: missing semi-colon, use of . operator instead of ->, use of -> operator
 
fixes include: missing semi-colon, use of . operator instead of ->, use of -> operator
 
instead of ., use of wrong member (gcc 6).
 
instead of ., use of wrong member (gcc 6).
  
 
[[File:CDTSemicolonFixit.png]]
 
[[File:CDTSemicolonFixit.png]]
 +
 +
[[File:CDTWrongMemberFixit.png]]
 +
 +
=== Support for -fdiagnostics-parseable-fixits ===
 +
 +
Clang and gcc 7 have support for generating fix-it suggestions for various compiler errors.  When
 +
the -fdiagnostics-parseable-fixits option is specified for the build, CDT is able to parse these
 +
fix-it messages and generate quick-fixes for them.
  
 
== Parser ==
 
== Parser ==

Revision as of 17:53, 30 May 2017

Release

This is the New & Noteworthy page for CDT 9.3 which is part of the Eclipse Oxygen release of June 2017

General

Editor

Open Declaration

C++11 "auto" variables

For variables whose type is declared with the C++11 auto keyword, Open Declaration on the auto opens the declaration of the deduced type (bug 511522).

Following includes in inactive code paths

Open Declaration can now follow #includes in inactive code paths (bug 379623).

Navigation to forward declaration of class template

Open Declaration now supports navigation from the definition of a class template to its forward declaration.

This can be useful in cases where some of the class template's template parameter have default arguments, as the default arguments may only be declared at the forward declaration.

CDTNavigateToFwdDeclBefore.png CDTNavigateToFwdDeclAfter.png

Open Declaration in assembly files

The Open Declaration action is now supported in assembly files.

CDTAssemblyOpenDeclBefore.png CDTAssemblyOpenDeclAfter.png

The action works on #include directives (bug 507285) and identifiers (bug 507974).

Content Assist

Completion of member functions when taking the address

After a classname qualifier such as MyClass::, CDT generally only offers static methods as completion proposals, since nonstatic methods need to be called on an object.

However, sometimes the address of a nonstatic method is taken, usually to be passed as a callback. CDT now recognizes the &MyClass:: form used to do this, and offers nonstatic methods as completion proposals (bug 395562).

CDTAddressofMethodCompletion.png

Improved content assist in inactive code

Content assist in inactive code (code disabled by an #ifdef) was improved in bug 72809. It's still not on par with content assist in active code, but completions for entities declared in active code preceding the point of invocation are now proposed.

Included files with no file extension

CDT now offers completion proposals for files with files extensions other than the usual C/C++ header file extensions (such as .h or .hpp) when content assist is invoked in an #include directive. This is useful for libraries that use header names with no extensions, such as Qt or KDE, as well as scenarios where non-header files (such as resource files) are included.

CDTIncludeCompletionNoExtension.png

To avoid polluting content assist proposals with irrelevant files, in cases where a directory contains both files with the usual C/C++ header extensions, and other files, proposals for files in the first category are shown first.

Enhanced parameter hints

CDT's parameter hints have been enhanced (bug 461680). They now show the full signature of the function being called, including its return type, containing class (if it's a method), and whether it's virtual.

CDTEnhancedParameterHint.png

Constructor completion with uniform initialization syntax

CDT's content assist now recognizes constructor calls that use the C++11 uniform initialization syntax and offers completion proposals for the constructor(s).

CDTUniformInitConstructorCompletion.png

Search

Enclosing definition of macro reference

In the Search view, the enclosing definition (function and class if applicable) is now shown for macro references the way it is for references to other entities (bug 508216).

CDTEnclosingDefForMacroReference.png


Placement of const

The const keyword can now be placed left or right to the type in a declaration specifier (bug 491957). A new preference sets the location (Preferences -> C/C++ -> Code Style):

CDTConstPlacementPreference.png

When CDT generates new source code (for exmaple in a refactoring) the const keyword will be written accordingly:

CDTConstPlacementInRefactoringPreview.png

To adapt all const occurrences in the current file there is an action Align Const in the Source menu (Mnemonic ctrl+shift+A):

CDTAlignConstSourceAction.png

Makefile Editor

Code Analysis

Gcc Build Quick-fixes

Quick fixes have been added for a variety of build errors generated by the gcc compiler. Such fixes include: missing semi-colon, use of . operator instead of ->, use of -> operator instead of ., use of wrong member (gcc 6).

CDTSemicolonFixit.png

CDTWrongMemberFixit.png

Support for -fdiagnostics-parseable-fixits

Clang and gcc 7 have support for generating fix-it suggestions for various compiler errors. When the -fdiagnostics-parseable-fixits option is specified for the build, CDT is able to parse these fix-it messages and generate quick-fixes for them.

Parser

More accurate binding resolution

This release fixes a long-standing issue where the indexer would resolve names in a source file that referenced entities that did not have a declaration in any file included by that source file, only in other files in the project.

As a result of this change, the set of semantic errors produced by the indexer should more closely resemble what an actual compiler produces.

Formatter

Build

Prebuild task and parallel make

Pre-build tasks and parallel make is now working together. Pre-build tasks can be used to generate header and source files as the pre-build task is now guaranteed to complete before any source code is built.

Also, the build targets under Project Settings -> C/C++ Build -> Behavior -> Workbench Build Behavior is respected and works the same for projects both with and without pre-build tasks.

This solves (bug 340300).

Debug

Support to extend the toolbar of the Debugger Console pages

Just like the standard Console view, the Debugger Console view now allows the use of the Console Page Participants extension point. By using this extension, extenders can add buttons to the toolbar of the different pages of the Debugger Console view. An example of such additions can be found in org.eclipse.cdt.examples.dsf.gdb/GdbExtendedConsolePageParticipant.java and has been copied below.

   <extension point="org.eclipse.ui.console.consolePageParticipants">
      <consolePageParticipant
            class="org.eclipse.cdt.examples.dsf.gdb.ui.console.GdbExtendedConsolePageParticipant"
            id="org.eclipse.cdt.examples.dsf.gdb.debuggerConsolePageParticipant">
         <enablement>
         <and>
            <instanceof value="org.eclipse.cdt.debug.ui.debuggerconsole.IDebuggerConsole"/>
            <!-- The below check only works with the Debugger Console view and not the
                 standard console view.  But that is ok since this contribution is
                 for the Debugger Console views only. -->
            <with variable="org.eclipse.core.runtime.Platform">
               <test property="org.eclipse.core.runtime.bundleState"
                     args="org.eclipse.cdt.examples.dsf.gdb"
                     value="ACTIVE">
               </test>
            </with>
         </and>
         </enablement>
      </consolePageParticipant>
   </extension>

Furthermore, a new method was added to provide access to the full console widget. This allows to modify or extend the behaviour of the full GDB console. The method in question is GdbFullCliConsolePage#getTerminalViewControl() which returns an ITerminalViewControl. ConsolePageParticipants are provided with the console page in their init() method; they can then cast it to GdbFullCliConsolePage to access the ITerminalViewControl.

This support was a contribution from Stephen Flynn from Dell-EMC.

Source not found editor modifications

User have now 3 choices to display the source not found editor :

 - Source you were jumping into is not found:
 - Function name known but can't find its source:
 - Unknown function name

CDTCSourceNotFoundEditor.png


API modifications

org.eclipse.cdt.dsf.gdb

  1. The method MIVariableManager.MIVariableObject#isComplex() has changed to always return false because we can't reliably determine whether a variable is complex or not (see bug 399494). Extenders should make sure that code calling this method will not misbehave.

Bugs Fixed in this Release

See Bugzilla report Bugs Fixed in CDT 9.3

Back to the top