Skip to content

ctags and etags generator for scala, with dependencies support

License

Notifications You must be signed in to change notification settings

strobe/sbt-ctags4s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-ctags4s

Warn

it's still experemental.

Status

Currently works only if sctags used as CLI utility if SCALA_LIB and SCALA_HOME enviroument variables configured according to sctags readme (see #1).

(Currently works only with Sbt 0.13x)

About

It able generate ctags file (currently in emacs format (aka etags)) for your project with tags for dependencies. (TAGS file allow you to get go to definition functionality for Scala files at text editors like emacs which has ctags support).

Tags file will be generated by patched version of SCtags (probably different tags generations backends will be available later).

In compasion to Exuberant Ctags current backend has better undestanding of Scala code specific and as result you will get much better failure rate at go to definition attempts.

Install

Just add following to your ./project/plugins.sbt file:

// libraryDependencies += "cc.evgeniy" %% "sctags" % "1.0.1" // this not required currently because of current classpath configuration issue see Warn section of readme
addSbtPlugin("cc.evgeniy" % "sbt-ctags4s" % "0.1.1")

Because of #1 currently you have to install sctags as separate CLI utility and provide correct set up for SCALA_HOME and SCALA_LIB.

How it works - example

First update your dependencies:

> ctagsDownload

Then select the dependency you wish to import for example scala-library:

> ctagsAdd <tab>...
> ctagsAdd org.scala-lang:scala-library...
... or ...
> ctagsAdd org.scala-lang*
... or ...
> ctagsAdd *

This will extract the scala-library source into .lib-src/org.scala-lang.scala-library/ and run ctags over the whole project including the imported sources. Both Java and Scala libs can be added.

Now you can use ctags to navigate the scala-library source.

Make sure to add the following to your .gitignore

.lib-src
tags
ctags

You can remove a library for your tags file with:

> ctagsRemove <tab>...
> ctagsRemove org.scala-lang...
... or ...
> ctagsRemoveAll
... or ...
> ctagsRemove *

Tasks

> help ctagsDownload
> help ctagsAdd
> help ctagsShowCurrent
> help ctagsRemove
> help ctagsRemoveAll

Roadmap

  • [] fix classpath setup issue #1
  • [] sbt settings which allow choose result format (etags, ctags) and backend kind (ctags, SCTags etc.)
  • [] sbt obsolete API reactor
  • [] add Sbt 1x support (with crossbuilding to 0.13x)

Credits

Currently it's just a mix of following projects:

License

Copyright 2017 Evgeniy Tokarev

Copyright (c) 2013 Kalman Bekesi

Copyright 2008 Geoff Reedy

Copyright 2015 Luben Karavelov

Published under the Apache License 2.0.

About

ctags and etags generator for scala, with dependencies support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages