mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 359392 - Source hover should not show source when hovering over function definition
This commit is contained in:
parent
e7f50acc25
commit
5adc3b3960
1 changed files with 12 additions and 4 deletions
|
@ -268,10 +268,18 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
LocationKind locationKind= LocationKind.LOCATION;
|
LocationKind locationKind= LocationKind.LOCATION;
|
||||||
if (name instanceof IASTName && !name.isReference()) {
|
if (name instanceof IASTName && !name.isReference()) {
|
||||||
IASTName astName= (IASTName)name;
|
IASTName astName= (IASTName)name;
|
||||||
if (astName.getTranslationUnit().getFilePath().equals(fileName) && fTU.getResource() != null) {
|
if (astName.getTranslationUnit().getFilePath().equals(fileName)) {
|
||||||
// reuse editor buffer for names local to the translation unit
|
int hoverOffset = fTextRegion.getOffset();
|
||||||
location= fTU.getResource().getFullPath();
|
if (hoverOffset <= nodeOffset && nodeOffset < hoverOffset + fTextRegion.getLength() ||
|
||||||
locationKind= LocationKind.IFILE;
|
hoverOffset >= nodeOffset && hoverOffset < nodeOffset + nodeLength) {
|
||||||
|
// bug 359352 - don't show source if its the same we are hovering on
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (fTU.getResource() != null) {
|
||||||
|
// reuse editor buffer for names local to the translation unit
|
||||||
|
location= fTU.getResource().getFullPath();
|
||||||
|
locationKind= LocationKind.IFILE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// try to resolve path to a resource for proper encoding (bug 221029)
|
// try to resolve path to a resource for proper encoding (bug 221029)
|
||||||
|
|
Loading…
Add table
Reference in a new issue