Java Code Examples for com.intellij.psi.util.QualifiedName#getParent()

The following examples show how to use com.intellij.psi.util.QualifiedName#getParent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QualifiedNameTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void testQ1() {
  QualifiedName qualifiedName = QualifiedName.fromDottedString("parent1.parent2.parent3");
  QualifiedName parent = qualifiedName.getParent();

  assertNotNull(parent);
  assertEquals(parent, QualifiedName.fromDottedString("parent1.parent2"));
}
 
Example 2
Source File: QualifiedNameTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void testQ2() {
  QualifiedName qualifiedName = QualifiedName.fromDottedString("parent1");
  QualifiedName parent = qualifiedName.getParent();

  assertNotNull(parent);
  assertEquals(parent, QualifiedName.fromDottedString(""));
}
 
Example 3
Source File: QualifiedNameTest.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void testQ3() {
  QualifiedName qualifiedName = QualifiedName.fromDottedString("");
  QualifiedName parent = qualifiedName.getParent();

  assertNull(parent);
}