本文整理汇总了Java中com.intellij.lang.javascript.psi.JSProperty.getQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java JSProperty.getQualifiedName方法的具体用法?Java JSProperty.getQualifiedName怎么用?Java JSProperty.getQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.lang.javascript.psi.JSProperty
的用法示例。
在下文中一共展示了JSProperty.getQualifiedName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubCompletions
import com.intellij.lang.javascript.psi.JSProperty; //导入方法依赖的package包/类
private List<LookupElement> getSubCompletions(PsiElement psiElement)
{
JSProperty property = PsiTreeUtil.getParentOfType(psiElement, JSProperty.class);
if (property == null)
{
return Collections.emptyList();
}
String name = property.getQualifiedName();
if (name == null)
{
return Collections.emptyList();
}
Setting setting = CompletionPreloader
.getCompletions()
.getSetting(name);
return setting != null ? setting.getSubCompletionVariants() : Collections.emptyList();
}
示例2: inspectProperty
import com.intellij.lang.javascript.psi.JSProperty; //导入方法依赖的package包/类
private void inspectProperty(JSProperty node)
{
String namespace = node.getQualifiedName();
done.add(namespace);
Setting setting = CompletionPreloader
.getCompletions()
.getSetting(namespace);
JSExpression nodeValue = node.getValue();
if (setting == null || nodeValue == null)
{
return;
}
String value;
// We don't want the quotes included.
try
{
JSLiteralExpression literalExpression = (JSLiteralExpression)nodeValue;
value = (String)literalExpression.getValue();
}
catch (Exception e)
{
value = nodeValue.getText();
}
String defaultValue = setting.getDefaultValue();
if (value == null)
{
return;
}
// Can't get hold of CodeStyleManager here because not dispatch. Manual labor ahead.
List<String> valueCandidates = generateCandidates(value);
List<String> defaultValueCandidates = generateCandidates(defaultValue);
Boolean someSortOfMatch = false;
for (String valueCandidate : valueCandidates)
{
if (defaultValueCandidates.contains(valueCandidate))
{
someSortOfMatch = true;
break;
}
}
if (!someSortOfMatch)
{
return;
}
holder.registerProblem(node, "Value equals default-value", new QuickFix());
}