@Test public void getLanguages() { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); List<String> result = CtagsUtil.getLanguages(env.getCtags()); assertNotNull("should get Ctags languages", result); assertTrue("Ctags languages should contains C++", result.contains("C++")); assertTrue("Ctags languages should contains OldC", result.contains("OldC")); }
public static List<String> getLanguages(String ctagsBinary) { Executor executor = new Executor(new String[]{ctagsBinary, "--list-languages"}); int rc = executor.exec(false); String output = executor.getOutputString(); if (output == null || rc != 0) { LOGGER.log(Level.WARNING, "Failed to get Ctags languages"); return null; } output = output.replaceAll("\\s+\\[disabled]", ""); String[] split = output.split("(?m)$"); List<String> result = new ArrayList<>(); for (String lang : split) { lang = lang.trim(); if (lang.length() > 0) { result.add(lang); } } return result; }
CtagsUtil { public static List<String> getLanguages(String ctagsBinary) { Executor executor = new Executor(new String[]{ctagsBinary, "--list-languages"}); int rc = executor.exec(false); String output = executor.getOutputString(); if (output == null || rc != 0) { LOGGER.log(Level.WARNING, "Failed to get Ctags languages"); return null; } output = output.replaceAll("\\s+\\[disabled]", ""); String[] split = output.split("(?m)$"); List<String> result = new ArrayList<>(); for (String lang : split) { lang = lang.trim(); if (lang.length() > 0) { result.add(lang); } } return result; } }
CtagsUtil { public static List<String> getLanguages(String ctagsBinary) { Executor executor = new Executor(new String[]{ctagsBinary, "--list-languages"}); int rc = executor.exec(false); String output = executor.getOutputString(); if (output == null || rc != 0) { LOGGER.log(Level.WARNING, "Failed to get Ctags languages"); return null; } output = output.replaceAll("\\s+\\[disabled]", ""); String[] split = output.split("(?m)$"); List<String> result = new ArrayList<>(); for (String lang : split) { lang = lang.trim(); if (lang.length() > 0) { result.add(lang); } } return result; } private  CtagsUtil(); }
CtagsUtil { public static List<String> getLanguages(String ctagsBinary) { Executor executor = new Executor(new String[]{ctagsBinary, "--list-languages"}); int rc = executor.exec(false); String output = executor.getOutputString(); if (output == null || rc != 0) { LOGGER.log(Level.WARNING, "Failed to get Ctags languages"); return null; } output = output.replaceAll("\\s+\\[disabled]", ""); String[] split = output.split("(?m)$"); List<String> result = new ArrayList<>(); for (String lang : split) { lang = lang.trim(); if (lang.length() > 0) { result.add(lang); } } return result; } private  CtagsUtil(); static boolean validate(String ctagsBinary); static List<String> getLanguages(String ctagsBinary); static void deleteTempFiles(); static Ctags newInstance(RuntimeEnvironment env); }
CtagsUtil { public static List<String> getLanguages(String ctagsBinary) { Executor executor = new Executor(new String[]{ctagsBinary, "--list-languages"}); int rc = executor.exec(false); String output = executor.getOutputString(); if (output == null || rc != 0) { LOGGER.log(Level.WARNING, "Failed to get Ctags languages"); return null; } output = output.replaceAll("\\s+\\[disabled]", ""); String[] split = output.split("(?m)$"); List<String> result = new ArrayList<>(); for (String lang : split) { lang = lang.trim(); if (lang.length() > 0) { result.add(lang); } } return result; } private  CtagsUtil(); static boolean validate(String ctagsBinary); static List<String> getLanguages(String ctagsBinary); static void deleteTempFiles(); static Ctags newInstance(RuntimeEnvironment env); static final String SYSTEM_CTAGS_PROPERTY; }