congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Location
Code IndexAdd Tabnine to your IDE (free)

How to use
Location
in
com.intellij.execution

Best Java code snippets using com.intellij.execution.Location (Showing top 10 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: 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: BashSupport/BashSupport

PsiElement psiElement = location.getPsiElement();
if (!psiElement.isValid()) {
  return false;
VirtualFile file = location.getVirtualFile();
if (file == null) {
  return false;
origin: dhleong/intellivim

Location<PsiClass> classLocation = el.getAncestorOrSelf(PsiClass.class);
PsiClass aClass = classLocation.getPsiElement();
Module module = JavaExecutionUtil.findModule(aClass);
origin: Camelcade/Perl5-IDEA

@Nullable
public VirtualFile findPerlFile(ConfigurationContext configurationContext) {
 Location location = configurationContext.getLocation();
 VirtualFile virtualFile = location == null ? null : location.getVirtualFile();
 return virtualFile != null && isExecutableFile(virtualFile) ? virtualFile : null;
}
origin: BashSupport/BashSupport

  @Override
  public boolean isConfigurationFromContext(BashRunConfiguration configuration, ConfigurationContext context) {
    Location location = context.getLocation();
    if (location == null) {
      return false;
    }

    //fixme file checks needs to check the properties

    VirtualFile file = location.getVirtualFile();
    return file != null && FileUtil.pathsEqual(file.getPath(), configuration.getScriptName());
  }
}
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: 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;
}
com.intellij.executionLocation

Most used methods

  • getPsiElement
  • getVirtualFile
  • getAncestorOrSelf
  • getAncestors

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Socket (java.net)
    Provides a client-side TCP socket.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 PhpStorm Plugins
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