@Test public void testGetDefinitions() throws Exception { File f1 = new File(repository.getSourceRoot() + "/git/main.c"); Definitions defs1 = IndexDatabase.getDefinitions(f1); assertNotNull(defs1); assertTrue(defs1.hasSymbol("main")); assertTrue(defs1.hasSymbol("argv")); assertFalse(defs1.hasSymbol("b")); assertTrue(defs1.hasDefinitionAt("main", 3, new String[1])); f1 = new File(repository.getSourceRoot() + "\\git\\main.c"); defs1 = IndexDatabase.getDefinitions(f1); assertNotNull(defs1); assertTrue(defs1.hasSymbol("main")); assertTrue(defs1.hasSymbol("argv")); assertFalse(defs1.hasSymbol("b")); assertTrue(defs1.hasDefinitionAt("main", 3, new String[1])); File f2 = new File(repository.getSourceRoot() + "/git/foobar.d"); Definitions defs2 = IndexDatabase.getDefinitions(f2); assertNull(defs2); }
public static Definitions getDefinitions(File file) throws ParseException, IOException, ClassNotFoundException { Document doc = getDocument(file); if (doc == null) { return null; } IndexableField tags = doc.getField(QueryBuilder.TAGS); if (tags != null) { return Definitions.deserialize(tags.binaryValue().bytes); } return null; }
IndexDatabase { public static Definitions getDefinitions(File file) throws ParseException, IOException, ClassNotFoundException { Document doc = getDocument(file); if (doc == null) { return null; } IndexableField tags = doc.getField(QueryBuilder.TAGS); if (tags != null) { return Definitions.deserialize(tags.binaryValue().bytes); } return null; } }
IndexDatabase { public static Definitions getDefinitions(File file) throws ParseException, IOException, ClassNotFoundException { Document doc = getDocument(file); if (doc == null) { return null; } IndexableField tags = doc.getField(QueryBuilder.TAGS); if (tags != null) { return Definitions.deserialize(tags.binaryValue().bytes); } return null; } IndexDatabase();  IndexDatabase(Project project); }
IndexDatabase { public static Definitions getDefinitions(File file) throws ParseException, IOException, ClassNotFoundException { Document doc = getDocument(file); if (doc == null) { return null; } IndexableField tags = doc.getField(QueryBuilder.TAGS); if (tags != null) { return Definitions.deserialize(tags.binaryValue().bytes); } return null; } IndexDatabase();  IndexDatabase(Project project); static void update(IndexChangedListener listener, List<String> paths); @SuppressWarnings("PMD.UseStringBufferForStringAppends") boolean addDirectory(String dir); void update(); void optimize(); void addIndexChangedListener(IndexChangedListener listener); static Set<String> getAllFiles(List<String> subFiles); Set<String> getFiles(); int getNumFiles(); void listTokens(int freq); static IndexReader getIndexReader(String path); static Definitions getDefinitions(File file); static Document getDocument(File file); @Override boolean equals(Object obj); @Override int hashCode(); }
IndexDatabase { public static Definitions getDefinitions(File file) throws ParseException, IOException, ClassNotFoundException { Document doc = getDocument(file); if (doc == null) { return null; } IndexableField tags = doc.getField(QueryBuilder.TAGS); if (tags != null) { return Definitions.deserialize(tags.binaryValue().bytes); } return null; } IndexDatabase();  IndexDatabase(Project project); static void update(IndexChangedListener listener, List<String> paths); @SuppressWarnings("PMD.UseStringBufferForStringAppends") boolean addDirectory(String dir); void update(); void optimize(); void addIndexChangedListener(IndexChangedListener listener); static Set<String> getAllFiles(List<String> subFiles); Set<String> getFiles(); int getNumFiles(); void listTokens(int freq); static IndexReader getIndexReader(String path); static Definitions getDefinitions(File file); static Document getDocument(File file); @Override boolean equals(Object obj); @Override int hashCode(); static final String INDEX_DIR; static final String XREF_DIR; static final String SUGGESTER_DIR; }