Skip to content

Commit

Permalink
language-server: completion for current scope skips setters if there …
Browse files Browse the repository at this point in the history
…is a getter to avoid duplicates (closes #32)
  • Loading branch information
joshtynjala committed Dec 14, 2016
1 parent f7363e4 commit b709b16
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2116,6 +2116,17 @@ private void autoCompleteScope(IScopedNode node, CompletionListImpl result)
}
if (!staticOnly || localDefinition.isStatic())
{
if (localDefinition instanceof ISetterDefinition)
{
ISetterDefinition setter = (ISetterDefinition) localDefinition;
IGetterDefinition getter = setter.resolveGetter(currentProject);
if (getter != null)
{
//skip the setter if there's also a getter because
//it would add a duplicate entry
continue;
}
}
addDefinitionAutoComplete(localDefinition, result);
}
}
Expand Down

0 comments on commit b709b16

Please sign in to comment.