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;
|
||||
if (name instanceof IASTName && !name.isReference()) {
|
||||
IASTName astName= (IASTName)name;
|
||||
if (astName.getTranslationUnit().getFilePath().equals(fileName) && fTU.getResource() != null) {
|
||||
// reuse editor buffer for names local to the translation unit
|
||||
location= fTU.getResource().getFullPath();
|
||||
locationKind= LocationKind.IFILE;
|
||||
if (astName.getTranslationUnit().getFilePath().equals(fileName)) {
|
||||
int hoverOffset = fTextRegion.getOffset();
|
||||
if (hoverOffset <= nodeOffset && nodeOffset < hoverOffset + fTextRegion.getLength() ||
|
||||
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 {
|
||||
// try to resolve path to a resource for proper encoding (bug 221029)
|
||||
|
|
Loading…
Add table
Reference in a new issue