Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml.Elem incorrectly displayed in worksheets #1835

Closed
ckipp01 opened this issue Jun 16, 2020 · 5 comments
Closed

xml.Elem incorrectly displayed in worksheets #1835

ckipp01 opened this issue Jun 16, 2020 · 5 comments
Labels
bug Something that is making a piece of functionality unusable
Milestone

Comments

@ckipp01
Copy link
Member

ckipp01 commented Jun 16, 2020

Describe the bug
When you try to use an xml literal in worksheets, you get some odd behavior where you just see a bunch of nested Elems.

To Reproduce
Steps to reproduce the behavior:

  1. Open a worksheet
  2. Try the following:
val test = <rss></rss>
  1. Save the worksheet
  2. See behavior

Screenshot 2020-06-16 at 19 39 55

Expected behavior
I would expect this to evaluate to something a bit more meaningful. For example, here is the output when ran in Ammonite:

@ val test = <rss></rss>
test: xml.Elem = <rss></rss>

Installation:

  • Operating system: macOS
  • Editor: Visual Studio Code and Vim
  • Metals version: Latest snapshot

Search terms
worksheets, xml

@tgodzik
Copy link
Contributor

tgodzik commented Jun 17, 2020

Thanks for reporting! This looks like an error in pprint:

object MainTest extends App{
  val test = <rss></rss>
  pprint.log(test)
}

produces:

image

@tgodzik
Copy link
Contributor

tgodzik commented Jun 17, 2020

Looks like this issue: com-lihaoyi/PPrint#33

Though, does ammonite use pprint underneath? Somebody reported this issue in pprint with an ammonite snippet 🤔

@ckipp01
Copy link
Member Author

ckipp01 commented Jun 17, 2020

Looks like this issue: lihaoyi/PPrint#33

Ah, of course, I didn't think about this being an issue with pprint.

Though, does ammonite use pprint underneath? Somebody reported this issue in pprint with an ammonite snippet 🤔

I don't think so, because when you run it with Ammonite shell, everything seems to go ok.

❯ amm
Loading...
Welcome to the Ammonite Repl 2.1.4 (Scala 2.13.2 Java 1.8.0_242)
@ val test = <rss></rss>
test: xml.Elem = <rss></rss>

@tgodzik
Copy link
Contributor

tgodzik commented Jun 17, 2020

I wanted to test it out myself and I was "Pity I don't have ammonite installed... wait a moment..."
cs install ammonite
amm

😄

I tried out the second option:
val x = <?xml-stylesheet href="style.xsl"?> and that has the same issue. Anyway I reported it in pprint just in case.

@tgodzik tgodzik added the bug Something that is making a piece of functionality unusable label Jun 17, 2020
@tgodzik
Copy link
Contributor

tgodzik commented Jul 15, 2020

Closing this issue in favour of the pprint one.

@tgodzik tgodzik closed this as completed Jul 15, 2020
@tgodzik tgodzik added this to the Metals v0.9.3 milestone Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable
Projects
None yet
Development

No branches or pull requests

2 participants