by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Brian P. Holt
    @bpholt
    Random feature request: autocomplete of the latest version of a dependency in a .sbt file
    Is anyone aware of such a thing?
    Gavin Bisesi
    @Daenyth
    I think there's an sbt plugin that allows you to use 1.^ version strings or so and then have a lock file to pin them, like some other languages do
    might work?
    OlegYch
    @OlegYch
    @bpholt i think it already supports that
    Brian P. Holt
    @bpholt
    🤯
    Idk, I tried it with different combinations of "org.typelevel" %% "cats-effect" % "2.1." to no avail :(
    OlegYch
    @OlegYch
    do you have maven plugin enabled?
    Brian P. Holt
    @bpholt
    hmm, good question
    probably not, I disabled all the plugins I thought I wouldn't need
    Gavin Bisesi
    @Daenyth
    whoa really?
    I also disabled maven, I had no idea I could do that
    OlegYch
    @OlegYch
    after updating indexes it should suggest versions
    although updating indexes doesn't seem to work for me atm
    Brian P. Holt
    @bpholt

    Yeah, after enabling it, I do get versions!

    Although… it only suggests 0.4, 0.10.1, and 2.0.0. Huh. (for cats-effect, I mean)

    It is warning me about a lot of unknown artifacts though, maybe I need to set something else up
    OlegYch
    @OlegYch
    damn my keymap is completely crapped in latest idea eap
    Oron Port
    @soronpo
    @OlegYch happened to me too
    The keymap thing
    OlegYch
    @OlegYch
    not sure if there is a better place
    Oron Port
    @soronpo
    But it looks like it's better to have a new issue
    Pavel Fatin
    @pavelfatin
    Just a quick reminder: you can follow https://twitter.com/IntelliJScala to get news and updates from the IntelliJScala team :)
    Philip
    @philipschwarz
    a bit off topic, but maybe someone can help
    I am writing some unison code - if I add the .u extension to the Haskell file type the result is quite good
    image.png
    image.png
    image.png
    image.png
    is there a way of stopping simbols like :arrow_right: && ++ () from being shown as if 'selected' (appearing in a box of a different, lighter colour) ?
    Nikolay Tropin
    @niktrop
    @philipschwarz It's probably better to ask author of Haskell plugin you are using.
    Philip
    @philipschwarz
    @niktrop doh, of course, thanks
    Jason Zaugg
    @retronym

    @niktrop I'm currently reimplementing scala-async as a phase of the compiler: scala/scala#8816 . A few details of name mangling are changing and I'm investigating how to adapt intellij-scala to these.

    The refactoring effort is in part to support a user of scala-async that integrates it via a compiler plugin that demarcates async blocks with annotations. The effect is quite similar to Kotlin's suspend functions. So I'd also like to find a way to make support for async in "evaluate expression" work in their environment, too. My idea is to detect replace (or augment) the current InsideAsync static analysis with a dynamic analysis of the enclosing classes in the VM at the breakpoint. If one of these has the 'fingerprint" of an async state machine, we can trigger the strategy of evaluating local variables and methods as selections of fields and methods from the state machine class.

    Does this sound like a reasonable approach? How does Kotlin's compiler/debugger handle things?

    While looking at this, I noticed at least one bug and an inefficient implemetation in some code contributed (as part of JetBrains/intellij-scala#386) to the the debugger. I'm tring to rework this in: https://github.com/retronym/intellij-scala/pull/1/commits/ea56504671599f5f837c21a05f592a154b141d4f

    For both of these changes I'd like to add a test case. I have a manual test in https://github.com/retronym/boxer/blob/topic/xasync/README.md. But rather than trying to introduce another third-party dependency to your build, I was thinking it would be simpler to have a debugger test that has one set of sources that will be loaded in the project when debugging, and a "shadow" set of sources that will be used to create the classfiles. The "shadow" sources can include the expansions that a compiler plugin would have made. If you think this approach makes sense,

    ... could you give a few pointers on how to refactor ScalaDebuggerTestBase to support that?
    If you have any general suggestions about ways that we could compile async state machines with better metadata to support debugging, please let me know.
    OlegYch
    @OlegYch
    is there a way to see what a type alias is actually referring to?
    OlegYch
    @OlegYch
    like alt-enter but on type
    Jason Zaugg
    @retronym

    could you give a few pointers on how to refactor ScalaDebuggerTestBase to support that?

    Here's the approach I'm working on: https://github.com/retronym/intellij-scala/pull/1/files#diff-463548c55f483c8570ee76caeb927a0eR19-R60

    The idea is to initially register the expanded source code (including synthetic wrappers), let the setUp() method compile it, and then temporarily edit the file within the test itself to remove the wrappers from the source code. Execution should use the classifies that include the synthetic wrappers.

    I'm having some problems running the tests today (after rebasing) so I'm not sure if my test implementation is correct. I'm re-running ;createIDEAArtifactXml ;idea-runner/createIDEARunConfiguration to see if that helps.

    Dmitrii Naumenko
    @unkarjedy

    @poslegm @olafurpg
    Sorry for the late reply! I saw your message last week but didn't have time to respond due to pre-release activities.

    scalatest, specs2, utest. What are the selection criteria for this list

    They were and still remain 3 most popular testing libraries at the moment their support was added.

    Regarding MUnit support:
    I will take a look at the state of MUnit later today and will reply what can be done in the ticket you've created: https://youtrack.jetbrains.com/issue/SCL-17360

    Nikolay Tropin
    @niktrop

    @retronym scala-async refactoring sounds very cool!

    My idea is to detect replace (or augment) the current InsideAsync static analysis with a dynamic analysis

    I think it may work even better than the current approach. Probably, the simplest option is to have a reserved word in a class name, so inner classes will contain it automatically.
    I know little about how debugger for kotlin coroutines works. AFAIK they are reworking it right now.

    Nikolay Tropin
    @niktrop

    The idea is to initially register the expanded source code (including synthetic wrappers), let the setUp() method compile it, and then temporarily edit the file within the test itself to remove the wrappers from the source code. Execution should use the classifies that include the synthetic wrappers.

    I'm not sure this approach is feasible because line numbers and other debug information for shadow sources will be completely different. I think it would be better to test the real thing, i.e. to compile a source code with a correct set of compiler options and compiler plugins.

    Nikolay Tropin
    @niktrop
    You'll probably need to provide custom ScalaSdkLoader in libraryLoaders method to use scala compiler with your changes. To change compiler options use
    ScalaCompilerConfiguration.instanceIn(getProject).defaultProfile (see, for example MetaAnnotationTestBase.enableParadisePlugin)
    Jason Zaugg
    @retronym

    I don't think the line numbers need to change. In:

    abstract class GetAllClassesForceTestBase extends PositionManagerTestBase {
      private val synthetic = "//<SYNTHETIC>"
    
      setupFile("Simple.scala",
        s"""
          |object Simple {
          |  def main(args: Array[String]) {
          |    class syntheticClass1 { class syntheticClass2 { $synthetic
          |    $offsetMarker"" $bp
          |    }}                                              $synthetic
          |  }
          |}
        """.stripMargin.trim)
      private def removingSyntheticLineContents(fileName: String)(f: => Unit): Unit ={
        val virtualFile = getVirtualFile(getFileInSrc(fileName))
        val charset = StandardCharsets.UTF_8
        val origiContent = virtualFile.contentsToByteArray()
        val content = new String(origiContent, charset)
        val edited = content.linesIterator.map(line => if (line.contains(synthetic)) "" else line).mkString(System.lineSeparator)
        virtualFile.setBinaryContent(edited.getBytes(charset))
        try f finally {
          virtualFile.setBinaryContent(origiContent)
        }
      }

    The idea is to just replace the wrapper lines with blank lines.

    The debugger session would have class files that include the wrappers but have source files without them.
    Nikolay Tropin
    @niktrop
    Hm, it may work. But still, it looks error prone and hard to maintain. If something changes in implementation, we'll need to rewrite the whole test case instead of updating versions of compiler and plugin.
    Jason Zaugg
    @retronym
    Yeah, that's a fair point. I'm hoping that details won't change again after this refactoring :)
    What am I doing wrong here?
    > runDebuggerTests
    [warn] Plugin [com.intellij.properties] is already included by: [org.intellij.groovy] in project 'android'
    [warn] Plugin [com.intellij.properties] is already included by: [org.intellij.groovy] in project 'gradle'
    [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
    [info] No tests to run for tasty-provided/test:testOnly
    [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
    [info] No tests to run for tasty-compile/test:testOnly
    [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
    [info] No tests to run for tasty-reader/test:testOnly
    [info] Passed: Total 0, Failed 0, Errors 0, Passed 0
    [info] No tests to run for tasty-runtime/test:testOnly
    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/Users/jz/.ScalaPluginIU/sdk/201.6668.60/lib/util.jar) to field java.io.DeleteOnExitHook.files
    WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    log4j:WARN No appenders could be found for logger (#com.intellij.testFramework.UsefulTestCase).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/Users/jz/.ScalaPluginIU/sdk/201.6668.60/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/Users/jz/.ScalaPluginIU/sdk/201.6668.60/plugins/maven/lib/maven36-server-impl.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
    ERROR: Cannot add 'scala-library.jar' from 'Scala VERSION' to compiler classpath
    java.lang.Throwable: Cannot add 'scala-library.jar' from 'Scala VERSION' to compiler classpath
        at com.intellij.openapi.diagnostic.Logger.error(Logger.java:146)
        at com.intellij.compiler.server.impl.BuildProcessClasspathManager.computeCompileServerPluginsClasspath(BuildProcessClasspathManager.java:127)
        at com.intellij.compiler.server.impl.BuildProcessClasspathManager.getStaticClasspath(BuildProcessClasspathManager.java:54)
        at com.intellij.compiler.server.impl.BuildProcessClasspathManager.getBuildProcessPluginsClasspath(BuildProcessClasspathManager.java:38)
        at com.intellij.compiler.server.BuildManager.launchBuildProcess(BuildManager.java:1240)
    That's from running sbt in a normal terminal with a fresh checkout of origin/idea201.x
    Jason Zaugg
    @retronym
    Or from the SBT Shell: