@@ -119,9 +119,8 @@ public void reset() {
119119
120120 /**
121121 * {@link #reset()}, and close any running ctags instance.
122- * @throws IOException not really thrown -- but logged
123122 */
124- public void close () throws IOException {
123+ public void close () {
125124 reset ();
126125 IOUtils .close (ctagsIn );
127126 if (ctags != null ) {
@@ -239,10 +238,10 @@ private void addRustSupport(List<String> command) {
239238
240239 // The following are not supported yet in Universal Ctags b13cb551
241240 command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?(static|const)[[:space:]]+(mut[[:space:]]+)?" +
242- "([[:alnum:]_]+)/\\ 4/C,consts,static constants /" );
241+ "([[:alnum:]_]+)/\\ 4/C,consts,staticConstants /" );
243242 command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?(unsafe[[:space:]]+)?impl([[:space:]\n ]*<[^>]*>)?" +
244243 "[[:space:]]+(([[:alnum:]_:]+)[[:space:]]*(<[^>]*>)?[[:space:]]+(for)[[:space:]]+)?" +
245- "([[:alnum:]_]+)/\\ 5 \\ 7 \\ 8/I,impls,trait implementations /" );
244+ "([[:alnum:]_]+)/\\ 5 \\ 7 \\ 8/I,impls,traitImplementations /" );
246245 command .add ("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?(unsafe[[:space:]]+)?trait[[:space:]]+([[:alnum:]_]+)/\\ 3/r,traits,traits/" );
247246 command .add ("--regex-rust=/^[[:space:]]*let[[:space:]]+(mut)?[[:space:]]+([[:alnum:]_]+)/\\ 2/V,variables/" );
248247 }
@@ -303,7 +302,7 @@ private void addKotlinSupport(List<String> command) {
303302 "(private[^ ]*|protected)?[[:space:]]*object[[:space:]]+([[:alnum:]_:]+)/\\ 4/o,objects/" );
304303 command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
305304 "(private[^ ]*|protected)?[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
306- "data class[[:space:]]+([[:alnum:]_:]+)/\\ 6/d,data classes /" );
305+ "data class[[:space:]]+([[:alnum:]_:]+)/\\ 6/d,dataClasses /" );
307306 command .add ("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
308307 "(private[^ ]*|protected)?[[:space:]]*interface[[:space:]]+([[:alnum:]_:]+)/\\ 4/i,interfaces/" );
309308 command .add ("--regex-kotlin=/^[[:space:]]*type[[:space:]]+([[:alnum:]_:]+)/\\ 1/T,types/" );
@@ -323,12 +322,12 @@ private void addClojureSupport(List<String> command) {
323322
324323 command .add ("--regex-clojure=/\\ ([[:space:]]*create-ns[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/n,namespace/" );
325324 command .add ("--regex-clojure=/\\ ([[:space:]]*def[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/d,definition/" );
326- command .add ("--regex-clojure=/\\ ([[:space:]]*defn-[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/p,private function /" );
325+ command .add ("--regex-clojure=/\\ ([[:space:]]*defn-[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/p,privateFunction /" );
327326 command .add ("--regex-clojure=/\\ ([[:space:]]*defmacro[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/m,macro/" );
328327 command .add ("--regex-clojure=/\\ ([[:space:]]*definline[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/i,inline/" );
329- command .add ("--regex-clojure=/\\ ([[:space:]]*defmulti[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/a,multimethod definition /" );
330- command .add ("--regex-clojure=/\\ ([[:space:]]*defmethod[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/b,multimethod instance /" );
331- command .add ("--regex-clojure=/\\ ([[:space:]]*defonce[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/c,definition (once) /" );
328+ command .add ("--regex-clojure=/\\ ([[:space:]]*defmulti[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/a,multimethodDefinition /" );
329+ command .add ("--regex-clojure=/\\ ([[:space:]]*defmethod[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/b,multimethodInstance /" );
330+ command .add ("--regex-clojure=/\\ ([[:space:]]*defonce[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/c,definitionOnce /" );
332331 command .add ("--regex-clojure=/\\ ([[:space:]]*defstruct[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/s,struct/" );
333332 command .add ("--regex-clojure=/\\ ([[:space:]]*intern[[:space:]]+([-[:alnum:]*+!_:\\ /.?]+)/\\ 1/v,intern/" );
334333 }
@@ -355,9 +354,9 @@ private void addScalaSupport(List<String> command) {
355354 command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
356355 "(private|protected)?[[:space:]]*object[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/o,objects/" );
357356 command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
358- "(private|protected)?[[:space:]]*case class[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/C,case classes /" );
357+ "(private|protected)?[[:space:]]*case class[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/C,caseClasses /" );
359358 command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
360- "(private|protected)?[[:space:]]*case object[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/O,case objects /" );
359+ "(private|protected)?[[:space:]]*case object[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/O,caseObjects /" );
361360 command .add ("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" +
362361 "(private|protected)?[[:space:]]*trait[[:space:]]+([a-zA-Z0-9_]+)/\\ 4/t,traits/" );
363362 command .add ("--regex-scala=/^[[:space:]]*type[[:space:]]+([a-zA-Z0-9_]+)/\\ 1/T,types/" );
@@ -433,12 +432,7 @@ public Definitions doCtags(String file) throws IOException,
433432 LOGGER .log (Level .WARNING ,
434433 String .format ("Terminating ctags process for file '%s' " +
435434 "due to timeout %d seconds" , file , getTimeout ()));
436- try {
437- close ();
438- } catch (IOException e ) {
439- LOGGER .log (Level .WARNING , "Failed to terminate overly long ctags command" );
440- }
441-
435+ close ();
442436 // Allow for retry in IndexDatabase.
443437 throw new InterruptedException ("ctags timeout" );
444438 }
@@ -464,7 +458,7 @@ public Definitions doCtags(String file) throws IOException,
464458 * @return definitions parsed from buffer
465459 * @throws java.lang.InterruptedException interrupted
466460 */
467- public Definitions testCtagsParser (String bufferTags )
461+ Definitions testCtagsParser (String bufferTags )
468462 throws InterruptedException {
469463
470464 // Ensure output is magic-terminated as expected.
@@ -495,7 +489,7 @@ public InputStream getErrorStream() {
495489 }
496490
497491 @ Override
498- public int waitFor () throws InterruptedException {
492+ public int waitFor () {
499493 return 0 ;
500494 }
501495
@@ -512,8 +506,7 @@ public void destroy() {
512506 CtagsReader rdr = new CtagsReader ();
513507 rdr .setTabSize (tabSize );
514508 readTags (rdr );
515- Definitions ret = rdr .getDefinitions ();
516- return ret ;
509+ return rdr .getDefinitions ();
517510 }
518511
519512 private void readTags (CtagsReader reader ) throws InterruptedException {
0 commit comments