Skip to content

Conversation

@AbaoFromCUG
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 7, 2026 16:32
@AbaoFromCUG AbaoFromCUG added the enhancement New feature or request label Jan 7, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the health check output by adding system information (OS platform and Neovim version), clarifying status descriptions, and consolidating notebook status information into a single info call instead of multiple separate calls.

  • Adds OS platform and Neovim version information to the version section
  • Restructures status output to display all notebook information in a single consolidated message
  • Updates README to clarify Neovim version requirements

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
lua/neopyter/health.lua Adds platform/version info, refactors notebook status display to build a single message string instead of multiple health.info calls
README.md Clarifies that both stable and nightly Neovim versions are supported

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.
)
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.
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.
Comment on lines +54 to +77
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)
end

health.info(msg)
end
health.info(msg)
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.
@AbaoFromCUG AbaoFromCUG merged commit 9d822af into master Jan 7, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants