コード例 #1
0
 @Override
 @NotNull
 public Map<String, Void> map(final FileContent inputData) {
   final String className = getControllerClassName(inputData.getContentAsText().toString());
   if (className != null) {
     return Collections.singletonMap(className, null);
   }
   return Collections.emptyMap();
 }
コード例 #2
0
  private static void updateStubIndices(
      @NotNull final Collection<StubIndexKey> indexKeys,
      final int inputId,
      @NotNull final Map<StubIndexKey, Map<Object, int[]>> oldStubTree,
      @NotNull final Map<StubIndexKey, Map<Object, int[]>> newStubTree) {
    final StubIndexImpl stubIndex = (StubIndexImpl) StubIndex.getInstance();
    for (StubIndexKey key : indexKeys) {
      final Map<Object, int[]> oldMap = oldStubTree.get(key);
      final Map<Object, int[]> newMap = newStubTree.get(key);

      final Map<Object, int[]> _oldMap =
          oldMap != null ? oldMap : Collections.<Object, int[]>emptyMap();
      final Map<Object, int[]> _newMap =
          newMap != null ? newMap : Collections.<Object, int[]>emptyMap();

      stubIndex.updateIndex(key, inputId, _oldMap, _newMap);
    }
  }
コード例 #3
0
 private static Map<StubIndexKey, Map<Object, int[]>> getStubTree(
     @NotNull final Map<Integer, SerializedStubTree> data) {
   final Map<StubIndexKey, Map<Object, int[]>> stubTree;
   if (!data.isEmpty()) {
     final SerializedStubTree stub = data.values().iterator().next();
     stubTree = new StubTree((PsiFileStub) stub.getStub(true), false).indexStubTree();
   } else {
     stubTree = Collections.emptyMap();
   }
   return stubTree;
 }
コード例 #4
0
 @NotNull
 @Override
 public Map<String, Void> map(@NotNull FileContent inputData) {
   final VirtualFile file = inputData.getFile();
   final String name = file.getName();
   if (PyNames.INIT_DOT_PY.equals(name)) {
     final VirtualFile parent = file.getParent();
     if (parent != null && parent.isDirectory()) {
       return Collections.singletonMap(parent.getName(), null);
     }
   } else {
     return Collections.singletonMap(FileUtil.getNameWithoutExtension(name), null);
   }
   return Collections.emptyMap();
 }