Package ro.redeul.google.go.inspection.fix

Source Code of ro.redeul.google.go.inspection.fix.DeleteStmtFixTest

package ro.redeul.google.go.inspection.fix;

import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import ro.redeul.google.go.GoEditorAwareTestCase;
import ro.redeul.google.go.lang.psi.GoFile;
import ro.redeul.google.go.lang.psi.GoPsiElement;

import static com.intellij.psi.util.PsiTreeUtil.findElementOfClassAtRange;

public class DeleteStmtFixTest extends GoEditorAwareTestCase {
    public void testSimple() throws Exception{ doTest(); }
    public void testOnlyOneVar() throws Exception{ doTest(); }
    public void testOnlyOneConst() throws Exception{ doTest(); }


    @Override
    protected void invoke(Project project, Editor editor, GoFile file) {
        int start = editor.getSelectionModel().getSelectionStart();
        int end = editor.getSelectionModel().getSelectionEnd();
        GoPsiElement element = findElementOfClassAtRange(file, start, end, GoPsiElement.class);
        DeleteStmtFix.deleteStatement(element);
    }

    @Override
    protected String getTestDataRelativePath() {
        return "fixes/deleteStmt/";
    }
}
TOP

Related Classes of ro.redeul.google.go.inspection.fix.DeleteStmtFixTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.