dscleaver / sbt-quickfix Goto Github PK
View Code? Open in Web Editor NEWSBT plugin that routes compiler and test errors into a quickfix file
License: Other
SBT plugin that routes compiler and test errors into a quickfix file
License: Other
Hello -- I followed the documentation in the README.md --
I put
addSbtPlugin("com.dscleaver.sbt" % "sbt-quickfix" % "0.4.1")
into ~/.sbt/0.13/plugins/plugins.sbt
.
However, nothing was applied when I started sbt. I found the plugin documentation
for sbt [1] says "You can create ~/.sbt/0.13/plugins/build.sbt and put addSbtPlugin() expressions in there to add plugins to all your projects at once".
I renamed my ~/.sbt/0.13/plugins/plugins.sbt
file to ~/.sbt/0.13/plugins/build.sbt
and started sbt. sbt then correctly downloaded this awesome plugin.
I think that "/.sbt/0.13/plugins/plugins.sbt" in the README should be changed to "/.sbt/0.13/plugins/build.sbt"
[1] http://www.scala-sbt.org/0.13/tutorial/Using-Plugins.html
When an error occurs, the plugin calls vim to load the quickfix file and sets vim's quickfix list. When the error is removed, the quickfix list in vim isn't reset although the quickfix file target/quickfix/sbt.quickfix is empty.
Expected behaviour: Reset the quickfix list in vim to an empty list when there no longer are any errors.
Hi,
I like the idea of this plugin very much, but haven't managed to get it to work. I followed the instructions and introduced an error into a scala file. I could see that the $project/target/quickfix/sbt.quickfix file was generated, but it was empty despite sbt telling me very clearly that I have an error in the file.
Some system information (please tell me if you need to know anything else):
I get the following error when running a multi-build project's tests. Some more information that might be helpful: I'm running a scala.js + Play project.
My project structure is :
root/scalajsProject/
root/playProject/
root/build.sbt
Please let me know if I can give any more information.
java.lang.NullPointerException
at java.lang.String.endsWith(String.java:1449)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$findSource$1.apply(QuickFixTestListener.scala:63)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$findSource$1.apply(QuickFixTestListener.scala:63)
at scala.collection.IndexedSeqOptimized$$anonfun$1.apply(IndexedSeqOptimized.scala:44)
at scala.collection.IndexedSeqOptimized$$anonfun$1.apply(IndexedSeqOptimized.scala:44)
at scala.collection.IndexedSeqOptimized$class.segmentLength(IndexedSeqOptimized.scala:189)
at scala.collection.mutable.ArrayBuffer.segmentLength(ArrayBuffer.scala:47)
at scala.collection.GenSeqLike$class.prefixLength(GenSeqLike.scala:92)
at scala.collection.AbstractSeq.prefixLength(Seq.scala:40)
at scala.collection.IndexedSeqOptimized$class.find(IndexedSeqOptimized.scala:44)
at scala.collection.mutable.ArrayBuffer.find(ArrayBuffer.scala:47)
at com.dscleaver.sbt.quickfix.QuickFixTestListener.findSource(QuickFixTestListener.scala:63)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$findInStackTrace$1.apply(QuickFixTestListener.scala:59)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$findInStackTrace$1.apply(QuickFixTestListener.scala:58)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
at scala.collection.mutable.ArrayOps$ofRef.flatMap(ArrayOps.scala:108)
at com.dscleaver.sbt.quickfix.QuickFixTestListener.findInStackTrace(QuickFixTestListener.scala:58)
at com.dscleaver.sbt.quickfix.QuickFixTestListener.find(QuickFixTestListener.scala:52)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$writeFailure$2.apply(QuickFixTestListener.scala:37)
at com.dscleaver.sbt.quickfix.QuickFixTestListener$$anonfun$writeFailure$2.apply(QuickFixTestListener.scala:35)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
at com.dscleaver.sbt.quickfix.QuickFixTestListener.writeFailure(QuickFixTestListener.scala:35)
at com.dscleaver.sbt.quickfix.QuickFixTestListener.testEvent(QuickFixTestListener.scala:23)
Hi,
this plug-in sounds very nice. None-Vim experts (e.g. me) are unable to get the Vim quickfix running by the Readme.
I think this could be also a problem for others. Could you elaborate this a little bit more inside the Readme.md?
Vim answers :cc1 with "No Error", but a target/quickfix/sbt.quickfix with a reported error exists.
Thanks, Jentsch
Ideally this would be easy to set when launching sbt, so perhaps an environment variable as well as a plugin setting.
I followed docs, but the plugin doesn't seem to load.
Currently using the Vundle manager for my Vim setup, and everything I install through Vundle works fine. I added the necessary things to ~/.sbt/0.13/plugins/plugins.sbt
, launched SBT in a project somewhere, and ran the install-vim-plugin
command which seems to have installed it fine (I see ~/.vim/bundle/vim-sbt
).
However, when I startup vim and hit <leader>ff
, nothing happens. I inspect :echo &rtp
in vim and I don't see vim-sbt
on there so I'm guessing Vundle won't add things to the runtimepath
unless it's installed through Vundle itself.
I tried adding the directory manually via
set runtimepath^=~/.vim/bundle/vim-sbt/plugin
But that didn't work either (though it does appear in :echo &rtp
).
The contents of ~/.vim/bundle/vim-sbt
match the resources
folder in the repository. Below are what I have in the ~/.sbt/0.13
folder
// global.sbt
import com.dscleaver.sbt.SbtQuickFix.QuickFixKeys._
vimEnableServer := false
// plugins/plugins.sbt
addSbtPlugin("com.dscleaver.sbt" % "sbt-quickfix" % "0.4.1")
Any guidance would be appreciated - thanks!
QuickFixLogger gets initialized but errors/warnings are not handled.
I get the following error in my SBT console: java.io.IOException: Cannot run program "gvim": error=2, No such file or directory
I use terminal vim as opposed to gvim. As far as I know, there isn't a reason that sbt-quickfix specifically depends on gvim, so it would be really nice if it could work with terminal vim as well. I'm happy to set a custom option if gvim is the preferred default.
I suspect the following line is the culprit:
The errorformat being used only seems to get the first line of multi-line errors in the quickfix file. This may have to do with how the quickfix file is generated. On the console, I see:
[error] /home/dylan/databrary/app/models/audit.scala:17: type mismatch;
[error] found : scala.concurrent.Future[Option[models.Party]]
[error] required: Option[models.Party]
In sbt.quickfix, I see:
[error] /home/dylan/databrary/app/models/audit.scala:17: type mismatch;
found : scala.concurrent.Future[Option[models.Party]]
required: Option[models.Party]
But in vim, I see:
models/audit.scala|17 col 69 error| type mismatch;
If I set errorformat as follows instead, things seem to work fine:
set errorformat=%E\ %#[error]\ %#%f:%l:\ %m,%-Z\ %#[error]\ %p^,%-C\ %#[error]\ %m,%C\ %m
set errorformat+=%W\ %#[warn]\ %#%f:%l:\ %m,%-Z\ %#[warn]\ %p^,%-C\ %#[warn]\ %m,%C\ %m
set errorformat+=%-G%.%#
The plugin currently uses cfile to load the quickfixfile into vim. This can be annoying and disrupting. I'd suggest to rather use cgetfile, which loads the quickfix files but doesn't make the cursor move. This way it's up to the users to handle changes in the quickfixlist as they like -- e.g. by defining a QuickFixCmdPost autocommand.
BTW one minor annoyance I found is that the plugin always uses the first gvim server. This can be a problem when users have multiple instances of gvim open. It would be nice if they could define somehow whether they want the sbt plugin to use a specific server.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.