@@ -77,9 +77,9 @@ predicate hasLocationInfo_Include(Include i, string path, int sl, int sc, int el
7777
7878/** Holds if `e` is a source or a target of jump-to-definition. */
7979predicate interestingElement ( Element e ) {
80- exists ( definitionOf ( e , _, true ) )
80+ exists ( definitionOf ( e , _) )
8181 or
82- e = definitionOf ( _, _, true )
82+ e = definitionOf ( _, _)
8383}
8484
8585/**
@@ -124,10 +124,7 @@ private predicate constructorCallTypeMention(ConstructorCall cc, TypeMention tm)
124124
125125/**
126126 * Gets an element, of kind `kind`, that element `e` uses, if any.
127- * If `includeTemplateInstantiations` is set, include information for
128- * elements `e` that are inside of template instantiations.
129- * Doing so yields multiple definitions for a single location, which can be
130- * undesirably. For example, lgtm.com does not support that.
127+ * Attention: This predicate yields multiple definitions for a single location.
131128 *
132129 * The `kind` is a string representing what kind of use it is:
133130 * - `"M"` for function and method calls
@@ -137,7 +134,7 @@ private predicate constructorCallTypeMention(ConstructorCall cc, TypeMention tm)
137134 * - `"I"` for import / include directives
138135 */
139136cached
140- Top definitionOf ( Top e , string kind , boolean includeTemplateInstantiations ) {
137+ Top definitionOf ( Top e , string kind ) {
141138 (
142139 // call -> function called
143140 kind = "M" and
@@ -200,13 +197,7 @@ Top definitionOf(Top e, string kind, boolean includeTemplateInstantiations) {
200197 not e .( Element ) .isInMacroExpansion ( ) and
201198 // exclude nested macro invocations, as they will overlap with
202199 // the top macro invocation.
203- not exists ( e .( MacroAccess ) .getParentInvocation ( ) ) and
204- (
205- includeTemplateInstantiations = true
206- or
207- includeTemplateInstantiations = false and
208- not e .isFromTemplateInstantiation ( _)
209- )
200+ not exists ( e .( MacroAccess ) .getParentInvocation ( ) )
210201 ) and
211202 // Some entities have many locations. This can arise for an external
212203 // function that is frequently declared but not defined, or perhaps
0 commit comments