Package com.jetbrains.lang.dart.psi

Examples of com.jetbrains.lang.dart.psi.DartComponent


  @NotNull
  @Override
  public SearchScope getUseScope() {
    final DartComponentType type = DartComponentType.typeOf(getParent());
    final DartComponent component = PsiTreeUtil.getParentOfType(getParent(), DartComponent.class, true);
    final boolean localType = type == DartComponentType.FUNCTION
                              || type == DartComponentType.PARAMETER
                              || type == DartComponentType.VARIABLE;
    if (localType && component != null) {
      return new LocalSearchScope(component);
View Full Code Here


  @Override
  protected boolean doExecute(final @NotNull DartComponentName componentName) {
    final PsiElement parentElement = componentName.getParent();

    if (parentElement instanceof DartComponent) {
      final DartComponent dartComponent = (DartComponent)parentElement;
      // try set getter or get setter
      if (myLValue && dartComponent.isGetter()) return true;
      if (!myLValue && dartComponent.isSetter()) return true;
    }

    if (this.myName.equals(componentName.getName()) && !isMember(DartComponentType.typeOf(parentElement))) {
      myResult.add(componentName);
      return false;
View Full Code Here

  @NotNull
  private static String getPresentableElementPosition(final @Nullable PsiElement element) {
    if (element == null) return "";

    final StringBuilder buf = new StringBuilder(element.getText());
    DartComponent component = PsiTreeUtil.getParentOfType(element, DartComponent.class);
    while (component != null) {
      final DartComponentName componentName = component.getComponentName();
      if (componentName != null && componentName != element) {
        buf.insert(0, component.getName() + " -> ");
      }
      component = PsiTreeUtil.getParentOfType(component, DartComponent.class);
    }
    String path = element instanceof PsiDirectoryImpl ? ((PsiDirectoryImpl)element).getVirtualFile().getPath()
                                                      : element.getContainingFile().getVirtualFile().getPath();
View Full Code Here

  private void doTest(String expectedDoc, String fileContents) throws Exception {
    final int caretOffset = fileContents.indexOf("<caret>");
    assertTrue(caretOffset != -1);
    final String realContents = fileContents.substring(0, caretOffset) + fileContents.substring(caretOffset + "<caret>".length());
    final PsiFile psiFile = myFixture.addFileToProject("test.dart", realContents);
    final DartComponent dartComponent = PsiTreeUtil.getParentOfType(psiFile.findElementAt(caretOffset), DartComponent.class);
    assertNotNull("target element not found at offset " + caretOffset, dartComponent);
    assertEquals(expectedDoc, DartDocUtil.generateDoc(dartComponent));
  }
View Full Code Here

TOP

Related Classes of com.jetbrains.lang.dart.psi.DartComponent

Copyright © 2018 www.massapicom. 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.