extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Add Vale extension for style and spellchecking

Open koozz opened this issue 1 year ago • 3 comments

Still need some help with troubleshooting, it seems to work at first. Dev extension works. Vale errors and warnings are shown.

image

Quickly after, the language server shuts down.

Any pointers on how to troubleshoot it further?

> tail -f ~/Library/Logs/Zed/Zed.log
2024-05-06T14:44:50+02:00 [INFO] compiling rust extension /Users/jan/git/github.com/koozz/zed-vale
2024-05-06T14:44:51+02:00 [INFO] finished compiling extension /Users/jan/git/github.com/koozz/zed-vale
2024-05-06T14:44:52+02:00 [INFO] rebuilt extension index in 20.117417ms
2024-05-06T14:44:52+02:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-05-06T14:44:52+02:00 [INFO] Initializing default prettier with plugins {}
2024-05-06T14:44:52+02:00 [INFO] starting language servers for Markdown:
2024-05-06T14:44:52+02:00 [INFO] Initializing default prettier with plugins {}
2024-05-06T14:44:52+02:00 [INFO] starting language servers for Markdown: vale
2024-05-06T14:44:52+02:00 [INFO] starting language server "vale", path: "/Users/jan/git/github.com/myproject", id: 1
2024-05-06T14:44:52+02:00 [INFO] rebuilt extension index in 15.916958ms
2024-05-06T14:44:52+02:00 [INFO] extensions updated. loading 0, reloading 1, unloading 0
2024-05-06T14:44:52+02:00 [INFO] Initializing default prettier with plugins {}
2024-05-06T14:44:52+02:00 [INFO] starting language servers for Markdown:
2024-05-06T14:44:52+02:00 [INFO] Initializing default prettier with plugins {}
2024-05-06T14:44:52+02:00 [INFO] starting language servers for Markdown: vale
2024-05-06T14:44:54+02:00 [INFO] starting language server. binary path: "/Users/jan/Library/Application Support/Zed/extensions/work/vale/vale-ls-v0.3.7/vale-ls", working directory: "/Users/jan/git/github.com/myproject", args: []
2024-05-06T14:45:41+02:00 [INFO] Waiting for default prettier to install
2024-05-06T14:45:41+02:00 [INFO] Starting prettier at path "/Users/jan/Library/Application Support/Zed/prettier"
2024-05-06T14:45:41+02:00 [INFO] Node runtime install_if_needed
2024-05-06T14:45:42+02:00 [INFO] starting language server. binary path: "/Users/jan/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/Users/jan/Library/Application Support/Zed/prettier", args: ["/Users/jan/Library/Application Support/Zed/prettier/prettier_server.js", "/Users/jan/Library/Application Support/Zed/prettier"]
2024-05-06T14:45:42+02:00 [INFO] Started default prettier in "/Users/jan/Library/Application Support/Zed/prettier"
2024-05-06T14:45:43+02:00 [ERROR] crates/lsp/src/lsp.rs:352: cannot read LSP message headers
2024-05-06T14:45:43+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:43+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down
2024-05-06T14:45:43+02:00 [ERROR] crates/lsp/src/lsp.rs:374: Broken pipe (os error 32)
2024-05-06T14:45:45+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:45+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down
2024-05-06T14:45:52+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:52+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down
2024-05-06T14:45:52+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:52+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down
2024-05-06T14:45:56+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:56+02:00 [ERROR] crates/project/src/project.rs:6949: server shut down
2024-05-06T14:45:57+02:00 [ERROR] crates/project/src/project.rs:2688: sending into a closed channel
2024-05-06T14:45:57+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down
2024-05-06T14:45:58+02:00 [WARN] Generic lsp request to vale-ls failed: server shut down

Fixes: #548

koozz avatar May 06 '24 13:05 koozz

The output from the language server is showing up in my editor, but I'm not sure why the log keeps mentioning that the language server shut down. Is this because of the interaction between Zed and vale-ls or is this purely vale-ls related?

koozz avatar May 10 '24 08:05 koozz

Looks like vale-ls is panicking: (see debug: open language server logs command in zed command palette)

initialized!
configuration changed!
stderr: thread 'main' panicked at src/server.rs:318:61:
stderr: called `Option::unwrap()` on a `None` value
stderr: stack backtrace:
stderr: 0: rust_begin_unwind
stderr: 1: core::panicking::panic_fmt
stderr: 2: core::panicking::panic
stderr: 3: core::option::unwrap_failed
stderr: 4: <vale_ls::server::Backend as tower_lsp::LanguageServer>::code_action::{{closure}}
stderr: 5: tower_lsp::jsonrpc::router::Router<S,E>::method::{{closure}}::{{closure}}::{{closure}}
stderr: 6: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
stderr: 7: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
stderr: 8: <futures_util::future::either::Either<A,B> as core::future::future::Future>::poll
stderr: 9: <core::pin::Pin<P> as core::future::future::Future>::poll
stderr: 10: <tower_lsp::service::LspService<S> as tower_service::Service<tower_lsp::jsonrpc::Request>>::call::{{closure}}
stderr: 11: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
stderr: 12: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next
stderr: 13: <futures_util::stream::stream::buffer_unordered::BufferUnordered<St> as futures_core::stream::Stream>::poll_next
stderr: 14: <futures_util::stream::stream::map::Map<St,F> as futures_core::stream::Stream>::poll_next
stderr: 15: <futures_util::stream::stream::forward::Forward<St,Si,Item> as core::future::future::Future>::poll
stderr: 16: <futures_util::future::maybe_done::MaybeDone<Fut> as core::future::future::Future>::poll
stderr: 17: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
stderr: 18: tokio::runtime::context::runtime::enter_runtime
stderr: 19: tokio::runtime::runtime::Runtime::block_on
stderr: 20: vale_ls::main
stderr: note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Reported upstream as well: errata-ai/vale-ls#12

jansol avatar May 14 '24 15:05 jansol

Thanks! I've been using the plugin locally and it does seem to work, but I was concerned with the logs.

koozz avatar May 15 '24 06:05 koozz

Anyone who can approve the extension? (@maxdeviant maybe?) As the underlying language server will be fixed eventually and a crashing language server is not noticeable to the user. The extension does get the job done and vale hints and diagnostics are shown.

koozz avatar May 30 '24 16:05 koozz

Anyone who can approve the extension? (@maxdeviant maybe?) As the underlying language server will be fixed eventually and a crashing language server is not noticeable to the user. The extension does get the job done and vale hints and diagnostics are shown.

Sorry about that! I didn't realize this was ready to merge.

I interpreted the crashing language server to be a blocking issue.

I will look it over now.

maxdeviant avatar May 30 '24 17:05 maxdeviant