Skip to content

feat: ✨ add follow_link and Marksman diagnostics filter#7

Merged
mozumasu merged 1 commit into
mainfrom
feat/follow-link
Jul 16, 2026
Merged

feat: ✨ add follow_link and Marksman diagnostics filter#7
mozumasu merged 1 commit into
mainfrom
feat/follow-link

Conversation

@mozumasu

Copy link
Copy Markdown
Owner

概要

[[notebook:name]] リンクの追跡 (gd ジャンプ) と Marksman の「Link to non-existent document」警告の除外を、dotfiles からプラグイン本体に移す。

Closes #6

変更内容

  • lua/nb/link.lua を追加
    • link_at_cursor() — カーソル下の notebook:name リンク文字列を返す(コロンなしの通常 wiki リンクは対象外)
    • follow_link() — リンク先ノートを開く。boolean を返し、フォールバック(LSP definition 等)は呼び出し側で選ぶ設計。LazyVim / LSP に非依存
    • enable_marksman_filter() — 診断フィルタ。グローバルハンドラではなく marksman client のハンドラのみをラップし、他の LSP に影響しない
  • config に marksman_filter オプションを追加(デフォルト有効)
  • README / vimdoc (:h nb-links) に API と gd キーマップ例を追記

動作確認

  • stylua --check lua/ パス
  • headless Neovim で確認:
    • カーソルがリンク上: link_at_cursor() がリンク文字列を返す
    • リンク外: nil / follow_link()false
    • 実ノート [[home:20260716202334.md]] 上で follow_link()true で該当ファイルが開いた

🤖 Generated with Claude Code

The [[notebook:name]] syntax is defined by this plugin, but resolving it
(gd jump) and suppressing Marksman's non-existent-document warnings lived
in user dotfiles, which had to track the link syntax. Move both into the
plugin: follow_link() returns a boolean so users choose their own
fallback, keeping the plugin free of LSP/distro assumptions, and the
diagnostics filter wraps only the marksman client handler instead of the
global one.

Closes #6

Co-Authored-By: Claude Fable 5 <[email protected]>
@mozumasu
mozumasu merged commit 33c64b9 into main Jul 16, 2026
2 checks passed
mozumasu added a commit to mozumasu/dotfiles that referenced this pull request Jul 16, 2026
The [[notebook:name]] parsing regex and the Marksman diagnostics filter
duplicated knowledge owned by nb.nvim (mozumasu/nb.nvim#7). Keep only
the gd binding here because overriding LazyVim's LspAttach gd is a
distro-specific timing concern.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

リンク追跡 (follow_link) と Marksman 診断フィルタをプラグインに移す

1 participant