-
Notifications
You must be signed in to change notification settings - Fork 6
misc: optimize health check info #46
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,8 @@ function M.check() | |||||
|
|
||||||
| health.start("neopyter: version") | ||||||
| local nvim_plugin_ver = jupyter.jupyterlab:get_nvim_plugin_version() | ||||||
| health.info(string.format("os platform of neovim: %s", vim.uv.os_uname().sysname)) | ||||||
| health.info(string.format("neovim version: %s", vim.version())) | ||||||
| if status then | ||||||
| health.info(string.format("neovim plugin(neopyter@%s) status: active", nvim_plugin_ver)) | ||||||
| local is_connecting = jupyter.jupyterlab:is_connecting() | ||||||
|
|
@@ -48,31 +50,31 @@ function M.check() | |||||
| end | ||||||
|
|
||||||
| health.start("neopyter: status") | ||||||
| health.info("attach=ready, connect=syncing\n") | ||||||
| health.info(string.format(" %-30s %-10s %-10s %s", "file", "attach", "connect", "remote_path")) | ||||||
| health.info("attach: tracking with neopyter\nconnect: synchronizing with jupyter lab\n") | ||||||
|
||||||
| health.info("attach: tracking with neopyter\nconnect: synchronizing with jupyter lab\n") | |
| health.info("attach: notebook is tracked by neopyter\nconnect: notebook is synchronized with jupyter lab\n") |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string.format call has 3 format specifiers (%s) but 4 arguments are provided. The nbconnect parameter is unused in the format string. Either add a format specifier for it or remove it from the arguments list.
| msg = msg .. "\n" .. string.format("%s %-30s %-10s false", select_mark, notebook.local_path, notebook:is_attached(), nbconnect) | |
| msg = msg .. "\n" .. string.format("%s %-30s %-10s false", select_mark, notebook.local_path, notebook:is_attached()) |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If jupyter.jupyterlab.notebook_map is empty, only the header row will be displayed without any notebook entries. Consider adding a check to display a message like "No notebooks currently tracked" when the map is empty to make the output clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
vim.version()function returns a table (with major, minor, and patch fields), not a string. When passed tostring.format, it will be converted to a string representation like "table: 0x..." which is not user-friendly. Consider usingtostring(vim.version())or formatting it properly with something likestring.format("%d.%d.%d", vim.version().major, vim.version().minor, vim.version().patch).