use of com.goide.runconfig.application.GoApplicationConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method testSameRunApplicationConfigurationOnPackage.
public void testSameRunApplicationConfigurationOnPackage() {
PsiFile file = myFixture.configureByText("a.go", "package main; <caret>\nfunc main() {}");
PsiElement at = file.findElementAt(myFixture.getCaretOffset());
assertNotNull(at);
ConfigurationContext configurationContext = new ConfigurationContext(at);
GoApplicationRunConfigurationProducer producer = new GoApplicationRunConfigurationProducer();
GoApplicationConfiguration runConfiguration = createRunAppFileConfiguration(file.getVirtualFile().getPath());
assertTrue(producer.isConfigurationFromContext(runConfiguration, configurationContext));
runConfiguration = createRunAppFileConfiguration(file.getVirtualFile().getPath() + "_vl");
assertFalse(producer.isConfigurationFromContext(runConfiguration, configurationContext));
}
use of com.goide.runconfig.application.GoApplicationConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method testSameRunApplicationConfigurationOnDirectory.
public void testSameRunApplicationConfigurationOnDirectory() {
PsiFile file = myFixture.addFileToProject("import/path/a.go", "package main; func main(){}");
PsiDirectory directory = file.getParent();
assertNotNull(directory);
ConfigurationContext configurationContext = new ConfigurationContext(directory);
GoApplicationRunConfigurationProducer producer = new GoApplicationRunConfigurationProducer();
GoApplicationConfiguration runConfiguration = createRunAppPackageConfiguration("import/path");
assertTrue(producer.isConfigurationFromContext(runConfiguration, configurationContext));
runConfiguration = createRunAppPackageConfiguration("import/path/other");
assertFalse(producer.isConfigurationFromContext(runConfiguration, configurationContext));
}
use of com.goide.runconfig.application.GoApplicationConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method createRunAppPackageConfiguration.
private GoApplicationConfiguration createRunAppPackageConfiguration(String importPath) {
GoApplicationRunConfigurationType type = GoApplicationRunConfigurationType.getInstance();
GoApplicationConfiguration result = new GoApplicationConfiguration(myFixture.getProject(), "run package", type);
result.setKind(GoApplicationConfiguration.Kind.PACKAGE);
result.setPackage(importPath);
return result;
}
use of com.goide.runconfig.application.GoApplicationConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method createRunAppFileConfiguration.
private GoApplicationConfiguration createRunAppFileConfiguration(String filePath) {
GoRunFileConfigurationType type = GoRunFileConfigurationType.getInstance();
GoApplicationConfiguration result = new GoApplicationConfiguration(myFixture.getProject(), "run file", type);
result.setKind(GoApplicationConfiguration.Kind.FILE);
result.setFilePath(filePath);
return result;
}
Aggregations