Skip to content

Commit

Permalink
json schema for javascript refactoring, when looking what properties …
Browse files Browse the repository at this point in the history
…json object has (to remove duplicates from completion variants), ignore non-quoted properties
  • Loading branch information
Iris24 committed Feb 22, 2017
1 parent a693d34 commit 430c439
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -136,7 +136,9 @@ public boolean hasPropertiesBehind(@NotNull PsiElement element) {
public Set<String> getPropertyNamesOfParentObject(@NotNull PsiElement element) {
final JsonObject object = PsiTreeUtil.getParentOfType(element, JsonObject.class);
if (object != null) {
return object.getPropertyList().stream().map(p -> StringUtil.unquoteString(p.getName())).collect(Collectors.toSet());
return object.getPropertyList().stream()
.filter(p -> StringUtil.isQuotedString(p.getName()))
.map(p -> StringUtil.unquoteString(p.getName())).collect(Collectors.toSet());
}
return Collections.emptySet();
}
Expand Down

0 comments on commit 430c439

Please sign in to comment.