Skip to content

Commit

Permalink
#172 - dont inject indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
giraud committed Jun 26, 2019
1 parent 8a2820d commit c0b0a05
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/com/reason/ide/search/FileModuleIndexService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import java.util.*;

public class FileModuleIndexService {
@NotNull
private final FileModuleIndex m_index;
@NotNull
private final NamespaceIndex m_nsIndex;

public FileModuleIndexService(@NotNull FileModuleIndex index, @NotNull NamespaceIndex nsIndex) {
m_index = index;
m_nsIndex = nsIndex;
public FileModuleIndexService(/*@NotNull FileModuleIndex index, @NotNull NamespaceIndex nsIndex*/) {
m_index = FileModuleIndex.getInstance();
m_nsIndex = NamespaceIndex.getInstance();
}

public static FileModuleIndexService getService() {
Expand Down
1 change: 0 additions & 1 deletion src/com/reason/ide/search/index/ExceptionIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public static ExceptionIndex getInstance() {
return INSTANCE;
}


@Override
public int getVersion() {
return super.getVersion() + VERSION;
Expand Down
6 changes: 6 additions & 0 deletions src/com/reason/ide/search/index/FileModuleIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class FileModuleIndex extends FileBasedIndexExtension<String, FileModuleD
private static final DataExternalizer<FileModuleData> EXTERNALIZER = new FileModuleDataExternalizer();
private static final int VERSION = 5;
private static final Log LOG = Log.create("index.file");
private static final FileModuleIndex INSTANCE = new FileModuleIndex();

@NotNull
public static FileModuleIndex getInstance() {
return INSTANCE;
}

public static final class FileModuleDataExternalizer implements DataExternalizer<FileModuleData> {
@Override
Expand Down
6 changes: 6 additions & 0 deletions src/com/reason/ide/search/index/NamespaceIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public class NamespaceIndex extends ScalarIndexExtension<String> {
private static final ID<String, Void> NAME = ID.create("reason.index.bsconfig");
private static final int VERSION = 4;
private static final Log LOG = Log.create("index.namespace");
private static final NamespaceIndex INSTANCE = new NamespaceIndex();

@NotNull
public static NamespaceIndex getInstance() {
return INSTANCE;
}

@NotNull
@Override
Expand Down

0 comments on commit c0b0a05

Please sign in to comment.