Search in sources :

Example 1 with GoSignature

use of com.goide.psi.GoSignature in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoEmptySignatureQuickFix method invoke.

@Override
public void invoke(@NotNull Project project, @NotNull PsiFile file, @Nullable("is null when called from inspection") Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) {
    GoFunctionDeclaration function = ObjectUtils.tryCast(startElement, GoFunctionDeclaration.class);
    GoSignature signature = function != null ? function.getSignature() : null;
    if (signature == null)
        return;
    signature.replace(GoElementFactory.createFunctionSignatureFromText(project, ""));
}
Also used : GoFunctionDeclaration(com.goide.psi.GoFunctionDeclaration) GoSignature(com.goide.psi.GoSignature)

Aggregations

GoFunctionDeclaration (com.goide.psi.GoFunctionDeclaration)1 GoSignature (com.goide.psi.GoSignature)1