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

Add Vale extension for style and spellchecking #691

Merged
merged 3 commits into from
May 30, 2024

Conversation

koozz
Copy link
Contributor

@koozz koozz commented May 6, 2024

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

Signed-off-by: Jan van den Berg <koozz@linux.com>
@cla-bot cla-bot bot added the cla-signed label May 6, 2024
@koozz
Copy link
Contributor Author

koozz commented May 10, 2024

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 koozz marked this pull request as ready for review May 10, 2024 08:15
@maxdeviant maxdeviant changed the title feat: Zed Vale, adding style and spellchecking Add Vale extension for style and spellchecking May 14, 2024
@jansol
Copy link

jansol commented May 14, 2024

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

@koozz
Copy link
Contributor Author

koozz commented May 15, 2024

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

@koozz
Copy link
Contributor Author

koozz commented May 30, 2024

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.

@maxdeviant
Copy link
Member

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.

Copy link
Member

@maxdeviant maxdeviant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@maxdeviant maxdeviant merged commit 830f4d4 into zed-industries:main May 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown (Vale)
3 participants