mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Document an internal method to make it easier for the next editor
While working on #251 I had to understand what this code did, I include the method javadoc in the hope it saves the next person who touches this code some time.
This commit is contained in:
parent
db84fe490d
commit
225cf469ca
1 changed files with 24 additions and 0 deletions
|
@ -294,6 +294,30 @@ public abstract class AbstractDebugTextHover implements ICEditorTextHover, IText
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to locate extent of the expression that name is part of.
|
||||||
|
*
|
||||||
|
* If name is a field or array reference, then try to find the
|
||||||
|
* parent expression that contains the field.
|
||||||
|
*
|
||||||
|
* For example, if name is f and f is a field of a structure, try
|
||||||
|
* to get the location of the variable containing the field.
|
||||||
|
*
|
||||||
|
* Given:
|
||||||
|
* <pre>
|
||||||
|
* struct s { int f1234; };
|
||||||
|
* #define macro(a) a
|
||||||
|
* struct s myvar;
|
||||||
|
* macro(myvar.f1234);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* if the name is f1234 from the last line, try to get the location
|
||||||
|
* corresponding to myvar.f1234
|
||||||
|
*
|
||||||
|
* @param name the name to find extent for
|
||||||
|
* @param pos out parameter for the the found position, or untouched
|
||||||
|
* if no new information is available.
|
||||||
|
*/
|
||||||
private void computeMacroArgumentExtent(IASTName name, Position pos) {
|
private void computeMacroArgumentExtent(IASTName name, Position pos) {
|
||||||
IASTImageLocation imageLoc = name.getImageLocation();
|
IASTImageLocation imageLoc = name.getImageLocation();
|
||||||
if (imageLoc == null) {
|
if (imageLoc == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue