Git Product home page Git Product logo

Comments (10)

parente avatar parente commented on May 30, 2024

The Scala interpreter is returning http://www.scala-lang.org/files/archive/nightly/2.12.x/api/2.12.x/scala-compiler/scala/tools/nsc/interpreter/Results$$Incomplete$.html for a comment-only input. It returns the same thing for a cell with code x = {.

from spylon-kernel.

mariusvniekerk avatar mariusvniekerk commented on May 30, 2024

Wonder if we can use pygments for this?

from spylon-kernel.

ericdill avatar ericdill commented on May 30, 2024

Wonder if we can use pygments for this?

Aren't you on vacation? 😀

from spylon-kernel.

parente avatar parente commented on May 30, 2024

Toree marks all cases of incomplete as a syntax error (https://github.com/apache/incubator-toree/blob/87a9eb8ad08406ce0747e92f7714d4eb54153293/kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/interpreter/tasks/ExecuteRequestTaskActor.scala#L95).

Either we go with that or we start having heuristics for special cases like "all of the lines in the cell are comments."

from spylon-kernel.

patrick-nicholson avatar patrick-nicholson commented on May 30, 2024

Is that the cause of Toree raising sytnax errors when the last line in a cell is a comment?

from spylon-kernel.

parente avatar parente commented on May 30, 2024

Certainly happens when the comment is the only thing in the cell. I don't know if it's the same spot in the code that logs the syntax error for a cell that has some code and a comment on the last line in Toree. (That oddity doesn't happen in spylon-kernel).

I'm leaning toward simply treating Results.Incomplete as an error (with output, not the silence it currently logs) and not inventing special parsing logic for the cell-with-comments-only case.

from spylon-kernel.

mariusvniekerk avatar mariusvniekerk commented on May 30, 2024

So Toree executes line by line. This is basically the exact same problem.

from spylon-kernel.

mariusvniekerk avatar mariusvniekerk commented on May 30, 2024

We can probably parse a scala code block with pygments and determine if it's all "blank".

from spylon-kernel.

patrick-nicholson avatar patrick-nicholson commented on May 30, 2024

Whatever causes this behavior (empty results returned by code-only cell) also worsens #26. If you run a cell with nothing but comments, all future print behaviors are disabled.

from spylon-kernel.

parente avatar parente commented on May 30, 2024

The withOut block wrapping that probably needs to be done per call to interpret to fix #26 will also implicitly fix this.

from spylon-kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.