-
Notifications
You must be signed in to change notification settings - Fork 11
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
--systemStream mode emits non LSP text, which breaks neovim #893
Comments
Hi Mitchell, by default we log into stdout Either way we will look into this issue, but it may be a quicker solution if this works for you |
@llibarona I appreciate the quick response! I currently have cloned the repository and built it using the instructions (which worked first try!). I can make that modification locally to see if it works! I would like to just be able to install it with homebrew I would prefer to use the --systemStream option, as i think it will be more reliable, but i was able to get the tcp socket mode working with this. (there are some bits that are particular to my config but they are unrelated). autocmd("FileType", {
group = random,
pattern = "raml",
callback = function()
local jobid = vim.fn.jobstart("als --port 9000 --listen")
if jobid > 0 then
vim.wait(1000, function() end)
vim.lsp.start {
name = "ALS",
cmd = vim.lsp.rpc.connect("127.0.0.1", 9000),
root_dir = vim.fs.dirname(vim.fs.find(".git", { upward = true })[1]),
settings = {},
capabilities = require("motch.lsp").capabilities,
on_attach = require("motch.lsp").on_attach,
}
else
vim.notify("Couldn't start ALS", vim.log.levels.WARN)
end
end,
}) |
@llibarona I made the following patch and it works now! I know nothing about Scala, but I believe this just logs to stderr instead of stdout. diff --git a/als-common/shared/src/main/scala/org/mulesoft/als/logger/PrintlnLogger.scala b/als-common/shared/src/main/scala/org/mulesoft/als/logger/PrintlnLogger.scala
index f54f3e83a..cfa0fb57f 100644
--- a/als-common/shared/src/main/scala/org/mulesoft/als/logger/PrintlnLogger.scala
+++ b/als-common/shared/src/main/scala/org/mulesoft/als/logger/PrintlnLogger.scala
@@ -10,7 +10,7 @@ import scala.scalajs.js.annotation.{JSExportAll, JSExportTopLevel}
@JSExportTopLevel("PrintLnLogger")
object PrintLnLogger extends AbstractLogger {
protected def executeLogging(msg: String, severity: MessageSeverity.Value): Unit =
- println(msg)
+ Console.err.println(msg)
override protected val settings: Option[LoggerSettings] = None |
Great to hear that @mhanberg ! I'm going to create an internal ticket in order to fix this in the future, but I'm happy you are able to use it already |
awesome, thank you for all the help! Feel free to close this issue if you are tracking it elsewhere. take care! |
I created the internal ticket: |
Your issue may already be reported! Please search on Github issues before creating one.
I'm submitting a ...
What is the current behavior?
running
java -jar path/to/jar --systemStream
emits a bunch text that isn't LSP rpc messagesIt should only emit the rpc messages on stdout so that it can work with stdio lsp clients correctly.
*What is the motivation/use case for changing the behavior? (for feature requests)
to use with neovim
Please tell us about your environment:
Other information (e.g. detailed explanation, stack traces, related issues, workarounds, links for us to have context, eg. StackOverflow, Gitter, etc)
I am using the following script and neovim code to start the LSP
The text was updated successfully, but these errors were encountered: