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

Helix editor causes Marksman to get stuck #45

Closed
erasin opened this issue Aug 18, 2022 · 8 comments
Closed

Helix editor causes Marksman to get stuck #45

erasin opened this issue Aug 18, 2022 · 8 comments

Comments

@erasin
Copy link

erasin commented Aug 18, 2022

as Title , lsp take error when change file .

2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "Unhandled exception: System.AggregateException: One or more errors occurred. (MailboxProcessor.PostAndAsyncReply timeout。)\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- " ---> System.TimeoutException: MailboxProcessor.PostAndAsyncReply timeout。\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at <StartupCode$FSharp-Core>[email protected](FSharpOption`1 res) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\mailbox.fs:line 472\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 525\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 112\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   --- End of inner exception stack trace ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at Ionide.LanguageServerProtocol.Server.startWithSetup[client](FSharpFunc`2 setupRequestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator) in /Users/runner/work/marksman/marksman/LanguageServerProtocol/LanguageServerProtocol.fs:line 170\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at Marksman.Program.startLSP(Int32 verbosity, Boolean waitForDebugger) in /Users/runner/work/marksman/marksman/Marksman/Program.fs:line 58\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at [email protected](Tuple`2 tupledArg)\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at FSharp.SystemCommandLine.CommandBuilders.SetHandlerInt@207-2.Invoke(InvocationContext ctx)\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext )\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "--- End of stack trace from previous location ---\n"
2022-08-18T19:34:09.381 helix_lsp::transport [ERROR] err <- "   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()\n"
2022-08-18T19:34:09.394 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-08-18T19:34:09.394 helix_lsp::transport [ERROR] err: <- StreamClosed
2022-08-18T19:34:11.320 helix_lsp::transport [ERROR] err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2022-08-18T19:34:11.320 helix_lsp::transport [ERROR] err: <- IO(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" })
2022-08-18T19:34:11.882 helix_lsp::transport [ERROR] err <- "[19:34:11 INF] <LSP Entry> Starting Marksman LSP server: {}\n"

os: macos 12.5
termial: alacritty
editor: helix
marksman: 1.0.0

lsp config: ~/.config/helix/languages.toml

[[language]]
name = "markdown"
indent = { tab-width = 4, unit = "    " }
file-types = ["md", "markdown"]
roots = [".git"]
language-server = { command = "marksman", args=["server"], language-id = "markdown" }

hx -vvv take log ~/.cache/helix/helix.log

@artempyanykh
Copy link
Owner

Thanks for the report @erasin ! Are you using the last released version: https://github.com/artempyanykh/marksman/releases/tag/2022-08-15 ?

The error reported is a timeout; basically, the server couldn't process a change within 5 seconds. This may happen if you have a lot (hundreds and hundreds) of markdown files. Or if you have something like node_modules in your repo which is not ignored, so the server pulls in a ton of unwanted markdown files.

(Side note: need #46 to simplify debugging)

@artempyanykh artempyanykh changed the title take error when change file Timeout error when editing a file Aug 18, 2022
@artempyanykh
Copy link
Owner

Thinking a bit more about this, it should be possible to make things responsive even for really huge workspaces by moving some of the work off of the critical section. More in #47

@erasin
Copy link
Author

erasin commented Aug 19, 2022

I install marksman from release.
2022-08-15 and 2022-08-07 have test .

All take same error.

.
├── book.toml
└── src
   ├── chapter_1.md
   └── SUMMARY.md

I take action that goto a file in summary.md , marksman take error when I change anther file.

@artempyanykh
Copy link
Owner

artempyanykh commented Aug 19, 2022

@erasin so there's just 2 md files? What's the size of these files?

Also, I haven't tried helix before. Maybe it has something to do with this...

@erasin could you provide more logs? What happens before the error. Please, use args=["server", "-v", "4"] in your helix config to make marksman output debug/trace logs.

@artempyanykh
Copy link
Owner

artempyanykh commented Aug 19, 2022

@erasin I could reproduce the issue. Basically, inserting any character in helix makes the server stuck. Things work fine in neovim and in emacs, so the problem is helix specific.

@artempyanykh artempyanykh changed the title Timeout error when editing a file Marksman gets stuck on non-ASCII characters Aug 19, 2022
@artempyanykh artempyanykh changed the title Marksman gets stuck on non-ASCII characters Helix editor causes Marksman to get stuck Aug 19, 2022
@artempyanykh
Copy link
Owner

#48 should fix the issue. As soon as CI passes, I'll merge and make a release.

@artempyanykh
Copy link
Owner

@erasin please try this release https://github.com/artempyanykh/marksman/releases/tag/2022-08-19 and let me know if it fixes things for you.

@erasin
Copy link
Author

erasin commented Aug 20, 2022

thanks ,It's work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants