question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax highlighting in scalac errors

See original GitHub issue

It would be great if SBT applying a few ansi colours to scalac output to make it easier to read. When I get 50 messgaes in a row like this ↓ it’s pretty hard to even see which file the error’s in.

[error] /home/golly/XxxXxx/projects/xxxxx/Code/webapp-client/src/main/scala/xxxxx/webapp/c
lient/app/ui/xxxx/edit/ColumnEditors.scala:136: not enough arguments for method apply: (in
itial0: Seq[xxxxx.webapp.base.data.Pubid], subjectId: xxxxx.webapp.base.data.XxxId, column
: xxxxx.webapp.client.app.ui.Xxxtable.Column, project: japgolly.scalajs.react.extra.Px[xxx
xx.webapp.base.data.Project], textSearch: japgolly.scalajs.react.extra.Px[xxxxx.webapp.bas
e.text.TextSearch], lookupM: japgolly.scalajs.react.extra.Px[xxxxx.base.util.Must[xxxxx.we
bapp.client.app.ui.Xxxtable.edit.ImplicationEditor.Lookup]], update: xxxxx.webapp.client.a
pp.ui.Xxxtable.Cell.State => scalaz.effect.IO[Unit], finish: xxxxx.webapp.client.app.ui.Xx
xtable.edit.EditResult[xxxxx.base.util.SetDiff[xxxxx.webapp.base.data.XxxId]] => scalaz.ef
fect.IO[Unit])xxxxx.webapp.client.app.ui.Xxxtable.Cell.State in object ImplicationEditor.
[error] Unspecified value parameter finish.

Btw, is it possible to add this as setting in my own SBT config? I was hoping to intercept all error logging messages and just apply a few regexs it doesn’t seem possible to modify the global logger. All I could find was info on extraLoggers, where as in this case you’d wouldn’t want to add loggers, just replace the global one.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dansanduleaccommented, Feb 9, 2016

I suspect this is because Defaults.scala:849 (in sbt 0.13.9) scopes compilerReporter under both the Compile configuration and the compile task. You can see this using inspect and notice that for compile:compilerReporter there are no reverse dependencies and hence it’s not used by anything, whereas compile:compile::compilerReporter tells a different story:

> inspect compile:compilerReporter
[info] No entry for key.
...

> inspect compile:compile::compilerReporter
[info] Task: scala.Option[xsbti.Reporter]
[info] Description:
[info]  Experimental hook to listen (or send) compilation failure messages.
[info] Provided by:
[info]  {file:/data/home/dsandul/testProj/}testProj/compile:compile::compilerReporter
[info] Defined at:
[info]  (sbt.Defaults) Defaults.scala:849
[info] Reverse dependencies:
[info]  testProj/compile:compileIncremental
...

So I’d just set

compilerReporter in (Compile, compile) := Some(new MyLoggerReporter(5, streams.value.log))
0reactions
eed3si9ncommented, Sep 30, 2019

I think this should be something implemented in Scala itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliJ suddenly stops highlighting errors in Scala/Dotty project
in my Scala project. I've tried type-aware highlighting, setting highlighting level to "Inspections", and enabling "Experimental Features" ...
Read more >
IntelliJ Scala Plugin 2019.2: Functional Code Highlighting ...
IntelliJ IDEA has always highlighted unused imports or unreachable code as “unused” (as defined by the Color Scheme). Other things, however, ...
Read more >
Syntax error in Scala files: Leading whitespace considered ...
Syntax highlighting issue with Scala code. After the underline feature was added, the whitespace preceding a class name is also underlined:.
Read more >
[Question] What causes IntelliJ Idea highlighter issues? : r/scala
I use Atom with syntax highlighting, Fira Code as my font, ... plenty of other issues with scala-ide, but accurate error reporting is...
Read more >
intellij not detecting errors, eclipse not showing syntax errors ...
You need to enable it. Settings/Code Style/Scala/Other settings/Enable experimental error highlighting Some things do show up as errors that aren't but not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found