Tabnine Logo
Location.getPsiElement
Code IndexAdd Tabnine to your IDE (free)

How to use
getPsiElement
method
in
com.intellij.execution.Location

Best Java code snippets using com.intellij.execution.Location.getPsiElement (Showing top 8 results out of 315)

origin: go-lang-plugin-org/go-lang-idea-plugin

 @Override
 public boolean shouldAccept(AbstractTestProxy test) {
  Location location = test.getLocation(project, searchScope);
  return location instanceof PsiLocation && location.getPsiElement() instanceof GoFunctionOrMethodDeclaration;
 }
});
origin: dboissier/mongo4idea

@Nullable
@Override
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext configurationContext) {
  sourceFile = location.getPsiElement().getContainingFile();
  if (sourceFile != null && sourceFile.getFileType().getName().toLowerCase().contains("javascript")) {
    Project project = sourceFile.getProject();
    VirtualFile file = sourceFile.getVirtualFile();
    RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(project, configurationContext);
    MongoRunConfiguration runConfiguration = (MongoRunConfiguration) settings.getConfiguration();
    runConfiguration.setName(file.getName());
    runConfiguration.setScriptPath(file.getPath());
    Module module = ModuleUtil.findModuleForPsiElement(location.getPsiElement());
    if (module != null) {
      runConfiguration.setModule(module);
    }
    return settings;
  }
  return null;
}
origin: liias/monkey

private static boolean isTestMethod(Location<? extends MonkeyFunctionDeclaration> location, boolean checkAbstract, boolean checkRunWith) {
 MonkeyFunctionDeclaration functionDeclaration = location.getPsiElement();
 MonkeyAnnotation annotation = functionDeclaration.getModifiers().getAnnotation();
 if (annotation == null) {
  return false;
 }
 String symbolName = Optional.ofNullable(annotation.getSymbol().getReferenceExpression())
  .map(MonkeyReferenceExpression::getId)
  .map(MonkeyId::getIdentifier)
  .map(PsiElement::getText).orElse(null);
 return TEST_ANNOTATION_NAME.equals(symbolName);
}
origin: liias/monkey

public static MonkeyFunctionDeclaration getTestMethod(PsiElement element, boolean checkAbstract, boolean checkRunWith) {
 PsiManager manager = element.getManager();
 Location<PsiElement> location = PsiLocation.fromPsiElement(manager.getProject(), element);
 Iterator<Location<MonkeyFunctionDeclaration>> iterator = location.getAncestors(MonkeyFunctionDeclaration.class, false);
 Location<MonkeyFunctionDeclaration> methodLocation;
 do {
  if (!iterator.hasNext()) {
   return null;
  }
  methodLocation = iterator.next();
 } while (!isTestMethod(methodLocation, checkAbstract, checkRunWith));
 return methodLocation.getPsiElement();
}
origin: intellij-dlanguage/intellij-dlanguage

final Location location = failedTest.getLocation(project, searchScope);
if (location != null) {
  final PsiElement psiElement = location.getPsiElement();
origin: liias/monkey

@Override
protected boolean setupConfigurationFromContext(AbstractMonkeyModuleBasedConfiguration configuration, ConfigurationContext context, Ref<PsiElement> sourceElement) {
 final Location location = context.getLocation();
 if (location == null) {
  return false;
 }
 if (!(location.getPsiElement().getLanguage() instanceof MonkeyLanguage)) {
  return false;
 }
 final Module contextModule = context.getModule();
 if (contextModule != null) {
  configuration.setModule(contextModule);
  configuration.setName(contextModule.getName());
 }
 configuration.setTargetDeviceId(TargetDevice.DEFAULT_DEVICE.getId());
 return true;
}
origin: dhleong/intellivim

PsiClass aClass = classLocation.getPsiElement();
Module module = JavaExecutionUtil.findModule(aClass);
origin: BashSupport/BashSupport

PsiElement psiElement = location.getPsiElement();
if (!psiElement.isValid()) {
  return false;
com.intellij.executionLocationgetPsiElement

Popular methods of Location

  • getVirtualFile
  • getAncestorOrSelf
  • getAncestors

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • setScale (BigDecimal)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Join (org.hibernate.mapping)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now