scala-clippy icon indicating copy to clipboard operation
scala-clippy copied to clipboard

colors (colours) not working on windows 10

Open cavapoo2 opened this issue 8 years ago • 8 comments

I followed the instructions on setting up. Seemed to install fine, also running (clippyColorsEnabled) in sbt came back as true. I tried using these terminals cmd, gitmsys and powershell. The colors seems the same as before.

cavapoo2 avatar Feb 01 '17 14:02 cavapoo2

note it might be partially working. when compile error occurs on long line, then function name is coloured yellow, and towards the end of the line it changes to purple. if I reduce the one long line to 2 lines, then this time the function name is not coloured yellow, the purple towards the end of the line is still purple.

cavapoo2 avatar Feb 01 '17 16:02 cavapoo2

screenshot 1

cavapoo2 avatar Feb 01 '17 16:02 cavapoo2

Thanks for reporting @arobson73 @adamw I did some initial investigation. For some reason the Ammonite highlighter doesn't properly use the fansi.Attr.Reset param passed here: https://github.com/softwaremill/scala-clippy/blob/master/plugin/src/main/scala-2.11/com/softwaremill/clippy/DelegatingPosition.scala#L19 Changing to fansi.color.Reset ot fansi.Color.makeAttr(Console.RESET, 0) doesn't do the trick either.

One possible but risky workaround would be to use the "light gray" color here instead of "Reset". However, this may affect output if someone uses custom terminal colors instead of light gray. I built a snapshot release with this workaround applied. @arobson73 could you try clippy version 0.5.1-SNAPSHOT? First, please make sure you have snapshot resolver added, for example in your .sbt/clippy.sbt file (the same place where you have defined clippyColorsEnabled := true):

resolvers += 
  "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

kciesielski avatar Feb 01 '17 22:02 kciesielski

import com.softwaremill.clippy.ClippySbtPlugin._ resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" clippyColorsEnabled := true

the above is now in my ~.sbt\0.13\build.sbt is this correct ? still seems to grab the 0.5.0 version [debug] Calling Scala compiler with arguments (CompilerInterface): [debug] -P:clippy:colors=true [debug] -Xplugin:C:\Users\andy.ivy2\cache\com.softwaremill.clippy\plugin_2.12\jars\plugin_2.12-0.5.0-bundle.jar [debug] -bootclasspath

cavapoo2 avatar Feb 02 '17 08:02 cavapoo2

@arobson73 you also need to change version to 0.5.1-SNAPSHOT in .sbt/0.13/plugins/build.sbt

kciesielski avatar Feb 02 '17 11:02 kciesielski

yes tried that. here is my .sbt/0.13/plugins/build.sbt

addSbtPlugin("com.softwaremill.clippy" % "plugin-sbt" % "0.5.1-SNAPSHOT")

here is my .sbt/0.13/build.sbt

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" import com.softwaremill.clippy.ClippySbtPlugin._ clippyColorsEnabled := true

here is the error I keep getting

[info] Loading global plugins from C:\Users\andy.sbt\0.13\plugins [info] Updating {file:/C:/Users/andy/.sbt/0.13/plugins/}global-plugins... [info] Resolving com.softwaremill.clippy#plugin-sbt;0.5.1-SNAPSHOT ... [warn] module not found: com.softwaremill.clippy#plugin-sbt;0.5.1-SNAPSHOT [warn] ==== typesafe-ivy-releases: tried [warn] https://repo.typesafe.com/typesafe/ivy-releases/com.softwaremill.clippy/plugin-sbt/scala_2.10/sbt_0.13/0.5.1-SNAPSHOT/ivys/ivy.xml [warn] ==== sbt-plugin-releases: tried [warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.softwaremill.clippy/plugin-sbt/scala_2.10/sbt_0.13/0.5.1-SNAPSHOT/ivys/ivy.xml [warn] ==== local: tried [warn] C:\Users\andy.ivy2\local\com.softwaremill.clippy\plugin-sbt\scala_2.10\sbt_0.13\0.5.1-SNAPSHOT\ivys\ivy.xml [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/com/softwaremill/clippy/plugin-sbt_2.10_0.13/0.5.1-SNAPSHOT/plugin-sbt-0.5.1-SNAPSHOT.pom [info] Resolving org.fusesource.jansi#jansi;1.4 ... [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.softwaremill.clippy#plugin-sbt;0.5.1-SNAPSHOT: not found [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes. [warn] com.softwaremill.clippy:plugin-sbt:0.5.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13) [warn] [warn] Note: Unresolved dependencies path: [warn] com.softwaremill.clippy:plugin-sbt:0.5.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13) (C:\Users\andy.sbt\0.13\plugins\build.sbt#L1-2) [warn] +- org.scala-sbt:global-plugins:0.0 (scalaVersion=2.10, sbtVersion=0.13) [trace] Stack trace suppressed: run last :update for the full output. [error] (:update) sbt.ResolveException: unresolved dependency: com.softwaremill.clippy#plugin-sbt;0.5.1-SNAPSHOT: not found Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

cavapoo2 avatar Feb 02 '17 13:02 cavapoo2

@arobson73 looks like snapshots repo is not being used. Could you also add the resolver line:

resolvers +=
 "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

to .sbt/0.13/plugins/build.sbt ?

kciesielski avatar Feb 02 '17 14:02 kciesielski

screenshot 2

looks better now. thanks

cavapoo2 avatar Feb 02 '17 15:02 cavapoo2