本文整理汇总了Java中com.intellij.lang.javascript.psi.JSParameter.getName方法的典型用法代码示例。如果您正苦于以下问题:Java JSParameter.getName方法的具体用法?Java JSParameter.getName怎么用?Java JSParameter.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.lang.javascript.psi.JSParameter
的用法示例。
在下文中一共展示了JSParameter.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkCatchSection
import com.intellij.lang.javascript.psi.JSParameter; //导入方法依赖的package包/类
private void checkCatchSection(JSCatchBlock section) {
final JSParameter param = section.getParameter();
final JSStatement block = section.getStatement();
if (param == null || block == null) {
return;
}
@NonNls final String paramName = param.getName();
if ("ignore".equals(paramName) || "ignored".equals(paramName)) {
return;
}
if (m_ignoreCatchBlocksWithComments) {
final PsiElement[] children = block.getChildren();
for (final PsiElement child : children) {
if (child instanceof PsiComment) {
return;
}
}
}
final CatchParameterUsedVisitor visitor =
new CatchParameterUsedVisitor(param);
block.accept(visitor);
if (!visitor.isUsed()) {
registerVariableError(param);
}
}
示例2: createStub
import com.intellij.lang.javascript.psi.JSParameter; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public JSParameterStub createStub(@NotNull JSParameter psi, StubElement parentStub)
{
String name = psi.getName();
int flags = JSParameterStubImpl.buildFlags(psi);
String typeString = psi.getTypeString();
String initializerText = psi.getInitializerText();
String qualifiedName = psi.getQualifiedName();
return new JSParameterStubImpl(name, flags, typeString, initializerText, qualifiedName, parentStub, this);
}
示例3: getSignatureForParameter
import com.intellij.lang.javascript.psi.JSParameter; //导入方法依赖的package包/类
public static String getSignatureForParameter(final JSParameter p, boolean skipType)
{
final String s = skipType ? null : p.getTypeString();
if(s != null && s.length() > 0)
{
final boolean ecmal4 = p.getContainingFile().getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4;
String result;
if(ecmal4)
{
if(p.isRest())
{
result = "...";
}
else
{
result = p.getName() + ":" + s;
}
}
else
{
result = "[" + s + "] " + p.getName();
}
final String initializerText = p.getInitializerText();
if(initializerText != null)
{
result += " = " + initializerText;
}
return result;
}
return p.getName();
}
示例4: buildFunctionBodyText
import com.intellij.lang.javascript.psi.JSParameter; //导入方法依赖的package包/类
@Override
protected String buildFunctionBodyText(final String retType, final JSParameterList parameterList, final JSFunction func)
{
@NonNls String functionText = "";
functionText += "{\n";
if(!"void".equals(retType))
{
functionText += " return";
}
else
{
functionText += " ";
}
functionText += " super." + func.getName();
if(func.isGetProperty())
{
}
else if(func.isSetProperty())
{
functionText += " = " + parameterList.getParameters()[0].getName();
}
else
{
functionText += "(";
boolean first = true;
for(JSParameter param : parameterList.getParameters())
{
if(!first)
{
functionText += ",";
}
first = false;
functionText += param.getName();
}
functionText += ")";
}
functionText += JSChangeUtil.getSemicolon(func.getProject()) + "\n}";
return functionText;
}