This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 247747
Collapse All | Expand All

(-)a/cnd.completion/src/org/netbeans/modules/cnd/completion/impl/xref/ReferenceResolverImpl.java (+5 lines)
Lines 159-162 Link Here
159
    public Collection<CsmReference> getReferences(CsmFile file) {
159
    public Collection<CsmReference> getReferences(CsmFile file) {
160
        return Collections.<CsmReference>emptyList();
160
        return Collections.<CsmReference>emptyList();
161
    }
161
    }
162
163
    @Override
164
    public boolean isStorage() {
165
        return false;
166
    }
162
}
167
}
(-)a/cnd.model.services/src/org/netbeans/modules/cnd/api/model/xref/CsmReferenceResolver.java (-1 / +23 lines)
Lines 51-56 Link Here
51
import javax.swing.JEditorPane;
51
import javax.swing.JEditorPane;
52
import javax.swing.text.Document;
52
import javax.swing.text.Document;
53
import org.netbeans.modules.cnd.api.model.CsmFile;
53
import org.netbeans.modules.cnd.api.model.CsmFile;
54
import org.netbeans.modules.cnd.api.model.CsmObject;
54
import org.netbeans.modules.cnd.modelutil.CsmUtilities;
55
import org.netbeans.modules.cnd.modelutil.CsmUtilities;
55
import org.openide.cookies.EditorCookie;
56
import org.openide.cookies.EditorCookie;
56
import org.openide.nodes.Node;
57
import org.openide.nodes.Node;
Lines 82-87 Link Here
82
     * @return reference for element on position "offset", null if not found
83
     * @return reference for element on position "offset", null if not found
83
     */
84
     */
84
    public abstract CsmReference findReference(CsmFile file, Document doc, int offset);
85
    public abstract CsmReference findReference(CsmFile file, Document doc, int offset);
86
    
87
    /**
88
     * Return true if resolver gets reference from file database.
89
     * 
90
     * @return 
91
     */
92
    public abstract boolean isStorage();
85
93
86
    /**
94
    /**
87
     * look for reference on specified position in file
95
     * look for reference on specified position in file
Lines 150-156 Link Here
150
            for (CsmReferenceResolver resolver : res.allInstances()) {
158
            for (CsmReferenceResolver resolver : res.allInstances()) {
151
                CsmReference out = resolver.findReference(file, doc, offset);
159
                CsmReference out = resolver.findReference(file, doc, offset);
152
                if (out != null) {
160
                if (out != null) {
153
                    return out;
161
                    if (resolver.isStorage()) {
162
                        // reference can be outdated
163
                        // check if referenced object is still alive
164
                        CsmObject referencedObject = out.getReferencedObject();
165
                        if (referencedObject != null) {
166
                            return out;
167
                        }
168
                    } else {
169
                        return out;
170
                    }
154
                }
171
                }
155
            }
172
            }
156
            return null;
173
            return null;
Lines 207-211 Link Here
207
            }
224
            }
208
            return list;
225
            return list;
209
        }
226
        }
227
228
        @Override
229
        public boolean isStorage() {
230
            return false;
231
        }
210
    }    
232
    }    
211
}
233
}
(-)a/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/impl/services/DeclarationReferenceResolverImpl.java (+5 lines)
Lines 87-90 Link Here
87
        }
87
        }
88
        return Collections.<CsmReference>emptyList();
88
        return Collections.<CsmReference>emptyList();
89
    }
89
    }
90
91
    @Override
92
    public boolean isStorage() {
93
        return true;
94
    }
90
}
95
}

Return to bug 247747