Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Ultimately, `Neopyter` can control `Juppyter lab`. `Neopyter` can implement abil
## Requirements

- 📔JupyterLab >= 4.0.0
- ✌️ Neovim latest
- ✌️ Neovim latest stable version or nightly version
- 👍`nvim-lua/plenary.nvim`
- 🤏`AbaoFromCUG/websocket.nvim` (optional for `mode="direct"`)

Expand Down
30 changes: 16 additions & 14 deletions lua/neopyter/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Copy link

Copilot AI Jan 7, 2026

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 to string.format, it will be converted to a string representation like "table: 0x..." which is not user-friendly. Consider using tostring(vim.version()) or formatting it properly with something like string.format("%d.%d.%d", vim.version().major, vim.version().minor, vim.version().patch).

Suggested change
health.info(string.format("neovim version: %s", vim.version()))
health.info(string.format("neovim version: %d.%d.%d", vim.version().major, vim.version().minor, vim.version().patch))

Copilot uses AI. Check for mistakes.
if status then
health.info(string.format("neovim plugin(neopyter@%s) status: active", nvim_plugin_ver))
local is_connecting = jupyter.jupyterlab:is_connecting()
Expand All @@ -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")
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Consider clarifying these definitions. The word "synchronizing" might be unclear - does it mean "currently syncing" or "configured to sync"? Also, "tracking with neopyter" could be more specific. For example: "attach: notebook is tracked by neopyter" and "connect: notebook is synchronized with jupyter lab".

Suggested change
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 uses AI. Check for mistakes.
local msg = string.format(" %-30s %-10s %-10s %s", "file", "attach", "connect", "remote_path")
for _, notebook in pairs(jupyter.jupyterlab.notebook_map) do
local select_mark = " "
if jupyter.notebook == notebook then
select_mark = "*"
end
local msg = ""
local nbconnect = notebook:is_connecting()

if nbconnect then
msg = string.format(
"%s %-30s %-10s %-10s %s",
select_mark,
notebook.local_path,
notebook:is_attached(),
nbconnect,
notebook.remote_path
)
msg = msg
.. "\n"
.. string.format(
"%s %-30s %-10s %-10s %s",
select_mark,
notebook.local_path,
notebook:is_attached(),
nbconnect,
notebook.remote_path
)
else
msg = 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(), nbconnect)
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
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 uses AI. Check for mistakes.
end

health.info(msg)
end
health.info(msg)
Comment on lines +54 to +77
Copy link

Copilot AI Jan 7, 2026

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.

Copilot uses AI. Check for mistakes.
else
health.info(string.format("neovim plugin(neopyter@%s) status: inactive", nvim_plugin_ver))
end
Expand Down
Loading