-
Notifications
You must be signed in to change notification settings - Fork 277
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
'ng scalafmt --stdin' throws exception 'java.io.IOException: Unknown stream type: H' #1115
Comments
What happens if you include |
Throws the same exception. |
Anything in vim-autoformat/vim-autoformat#184 that could help? |
@olafurpg: I have basically followed the instructions there... and it used to work just fine. But a week ago I have updated the Mac OS X with the recommended updates and in addition I ran |
Can you try upgrading the nailgun dependency in the repo and cli/assembly
to test if that helps?
…On Tue, 27 Feb 2018 at 12:38, hacker-works ***@***.***> wrote:
@olafurpg <https://github.com/olafurpg>: I have basically followed the
instructions there... and it used to work just fine. But a week ago I have
updated the Mac OS X with the recommended updates and in addition I ran brew
upgrade
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABV8XcLHbci5FbJlVwi1NzdL82Y3UVssks5tY-k2gaJpZM4SUr_O>
.
|
Maven repos provide only nailgun |
OK, so what I did was:
Now I have I've changed in the resolvers ++= Seq(Resolver.mavenLocal, Resolver.sonatypeRepo("releases"))
@olafurpg: So, how should I test the build? |
Summary of what I've tried so far: My changes to
I have built and installed locally Then I have reinstalled
And I've restarted
And then tested it again:
So, seems changing the NOTE: What is strange to me is that |
What does |
Just tried following installation nailgun installation for scalafmt and I am able to reproduce the problem. Not sure what to do. @pjrt do you still use scalafmt through vim? |
I do use it through vim, but not as part of the I never tried to get nailgun running, though this issue makes me want to try it.. |
Same here! |
@hacker-works What happens if you use http://search.maven.org/#artifactdetails%7Cch.epfl.scala%7Cnailgun-server%7C4ecd1a7d%7Cjar for the nailgun-server and this nailgun client https://github.com/facebook/nailgun/blob/master/pynailgun/ng.py ? |
FWIW, checking out tag |
Any actionable item that be done to close this ticket? I personally don't use the nailgun integration, but I am able to reproduce the bug and it would be great to have working nailgun. OTOH, I am optimistic we will have Scala Native support in the coming few months #1172 |
@olafurpg: I don't think there is. Thank you for the help, everyone! |
OK, I'll close this ticket then in favor of #1172. I am optimistic scala native support will avoid the need for nailgun altogether |
If you clone the nailgun repository, it builds just fine. However, if you try to use this version of nailgun with scalafmt [1], it doesn't actually work [2]. In [2], they suggest building the nailgun-all-0.9.1 tag. But, this tag doesn't build because of javadoc errors. This commit fixes those errors so that the code builds again. [1]: https://scalameta.org/scalafmt/#Nailgun [2]: scalameta/scalafmt#1115
This is not a solution but another workaround. Setting the following in vim-autoformat settings worked for me.
Works without using the Probably vim-autoformat pipes the file contents to the stdin of this call. It looks like that gets ignored without problems. |
For people using the nailgun integration, I recommend trying out the graalvm native image in #1266 Please report back how it works. |
I'm using
scalafmt
throughnailgun
:Steps
Given code like this:
When I run scalafmt like this:
cat spark.scala | scalafmt --stdin
The output on
stdin
is just as expected:But when I run scalafmt with nailgun:
Problem
I'm getting an exception that I didn't got before (my setup used to work just fine a week ago):
Expectation
My expectation is that instead of exception it'll output the formatted file.
Workaround
On the other hand
ng scalafmt spark.scala
formats the file as expected.Notes
I have looked at the nailgun code indicated in the exception. This code is found only in nailgun 0.9.1. Mac OS X brew is installing only nailgun 0.9.3
Currently, Scalafmt is using nailgun 0.9.1 as a build dependency:
scalafmt/build.sbt
Line 61 in 3df7c03
The text was updated successfully, but these errors were encountered: